Tell us about yourself!

Complete Your Profile
  • How to Use 2.4 Inch TFT LCD SPFD5408 With Arduino Uno and Mega

    Thanks much, Joao! I was dreading getting started trying to make these little displays work, with no documentation and the word on the street being that even displays that looked alike might have different controllers. There were several Arduino libraries to pick from, but yours looked relatively straightforward and I liked your Instructables writeup. The libraries and the graphics test sketch worked, kind-of, with same problems as padouet reported, but it was fairly easy to find fixes for those, and now the graphics test sketch is working correctly. (Fixes noted below...)

    Hello padouet,I had EXACTLY the same problem this evening when I first started. I fixed each problem with some code changes:First, the colors. I just swapped the color definitions in the test sketch. There may be a better way, but this works. Swap white and black; swap blue and yellow; swap red and cyan; swap green and magenta. (I need to dig into this a little further. The datasheet for the ILI9341 clearly shows 6 bits per color, but in the sketch, only 16 bits are used to define the colors... Also, it may be possible to send some bit(s) to the ILI9341/2 to invert the colors. I only started to look at the data sheet maybe two hours ago, so there is a lot in it I have not investigated.)Second, for the reversed text: in SPFD5408_Adafruit_TFTLCD.cpp, look for lines with ILI9341_MA...

    see more »

    Hello padouet,I had EXACTLY the same problem this evening when I first started. I fixed each problem with some code changes:First, the colors. I just swapped the color definitions in the test sketch. There may be a better way, but this works. Swap white and black; swap blue and yellow; swap red and cyan; swap green and magenta. (I need to dig into this a little further. The datasheet for the ILI9341 clearly shows 6 bits per color, but in the sketch, only 16 bits are used to define the colors... Also, it may be possible to send some bit(s) to the ILI9341/2 to invert the colors. I only started to look at the data sheet maybe two hours ago, so there is a lot in it I have not investigated.)Second, for the reversed text: in SPFD5408_Adafruit_TFTLCD.cpp, look for lines with ILI9341_MADCTL_MX. You should find only two such lines, in case 1 and case 2 of the section that deals with rotation. Remove that part (and the following | ) from those two cases and add it to case 0 and case 3. This swaps the "X" direction for each rotation. (The definition of ILI9341_MADCTL_MX is in registers.h; it's just the bit position of MX in the ILI9341 memory address control register.)Third, for the portrait <-> landscape problem, I just swapped the sizes in the #defines for TFTWIDTH and TFTHEIGHT. It occurs to me that I might have been able to do it differently; I suppose it could depend on what you want to think of as the width and the height of the display: are you using it in portrait or in landscape orientation. But anyway, that worked for me. It's late; I'll try playing with the other tests tomorrow!

    View Instructable »