My first post back from hiatus talked about how I was getting into hardware components and programming them. Although I’ve had both hardware and software experience, the experience of producing home-grown hardware/software solutions is something new to me. It is very fascinating though and I am absolutely gitty about it… just ask my coworkers. I can’t shut up about it.
As you may have read in the previous post, after careful consideration I ordered up a bunch of hardware. For the sake of this article, however, only two items will be important from that list. They are the Seeeduino Mega 2560 ADK dev board and the 2.8″ TFT Touch Shield. The problem I was experiencing was that when I plugged the 2.8″ TFT Touch Shield (“shield”) into the Seeeduino Mega 2560 ADK (“Seeeduino”), all I got was a white background with the backlight on. There was nothing else going on. I tried just about every library under the sun, every example, my own code, searching Google for solutions, etc. I saw that lots of folks were having this problem, but no one had any solutions. So, I eventually posted the problem to the Seeduino forums.
I didn’t get any replies, only more people with the same issue getting in on the action. Fortunately someone at Seeeduino took pitty on me and emailed me about it. After a couple of emails back and forth it turns out the fix is quite easy. It has to do with the Mega 2560 pinout being different than the standard arduino/seeeduino. As you can see in the image below, the regular Arduino (Uno for instance) has 14 Digital I/O pins and 6 analog input pins whereas the Mega 2560 has 54 digital I/O pins and 16 analog input pins.
Due to this difference the screen has to use different pins. Unfortunately the example sketches in the TFT library don’t tell you that you have to change anything so what you wind up with on the Mega 2560 boards is the TFT screen with a blank white background and the backlight on.
Note: If you don’t have the TFT library, you can obtain it here.
Here’s how to fix it.
- Open Notepad
- Click Start > All Programs > Accessories > Click Notepad
- Click File > Open
- Browse to C:\Program Files\Arduino\Libraries\TFT\
- To the right of File name, select “All Files (*.*)” from the drop down list
- It will currently have “Text Documents (*.txt)” selected, disallowing you to see the TFT.h file.
- Select TFT.h and click Open
- Scroll down to where it says “#define SEEEDUINO” (approximately line 29)
- Change the word SEEEDUINO to say MEGA.
- Click File > Save
- Close Notepad
Congratulations! You’ve successfully fixed the TFT library so that you can use it with a Arduino or Seeeduino Mega 2560 or Mega 2560 ADK! On my board I tested it out and everything was great after that! Try the drawCircle sketch from the library examples once you fix this.