2.8" TFT + reset pin

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
ztik.nl
 
Posts: 21
Joined: Thu Jan 17, 2013 3:43 pm

2.8" TFT + reset pin

Post by ztik.nl »

Hi again,

I am still happily using my 2.8" TFT touchscreen (breakout, not the shield), but I have been trying to figure something out I thought was pretty straightforward...
The code examples all contain the following lines:

Code: Select all

#define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin
/* a bit further */
Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET); // setup TFT library
If I want to connect the reset pin on the TFT to the reset pin on my Teensy (or an Arduino), how would I define this in the settings?
Simply removing the ', LCD_RESET' will result in compile errors due to missing values.

Also, if I check the library, all I can see is that the reset pin is using digital pin functions, why is it connected to an analog pin instead?

I'm probably overlooking something simple though... :x

edit: added link to code example

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: 2.8" TFT + reset pin

Post by adafruit_support_rick »

Change the definition of LCD_RESET to 0, and then connect the reset jumper to the arduino's reset pin.

Code: Select all

#define LCD_RESET 0
The analog pins on an arduino are also digital pins. They're labeled 'analog' because they support analog input in addition to digital I/O.

User avatar
ztik.nl
 
Posts: 21
Joined: Thu Jan 17, 2013 3:43 pm

Re: 2.8" TFT + reset pin

Post by ztik.nl »

Thank you for that reply, I set LCD_RESET to 0, and it works perfectly!

About the Analog/Digital pin, I understand that these pins have dual functionality, but what I don't understand is that the reset button (according to the library code) does nothing except

Code: Select all

    digitalWrite(reset, HIGH);
    pinMode(reset, OUTPUT);
And a bit further in the code:

Code: Select all

    digitalWrite(_reset, LOW);
    delay(2);
    digitalWrite(_reset, HIGH);
So I don't see why the examples and the tutorial prefer to use an Analog+Digital combo pin instead of a normal Digital pin.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: 2.8" TFT + reset pin

Post by adafruit_support_rick »

No idea. It's up to whoever writes the code. Maybe they didn't want people to get it mixed up with the data lines? Maybe they adapted it from some other code where the analog pins were all that were left?

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”