1.8" TFT LCD SD

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
brewski850
 
Posts: 3
Joined: Tue Aug 27, 2013 8:25 pm

1.8" TFT LCD SD

Post by brewski850 »

Just received my 1.8" TFT LCD and have graphics test running. I connected it via a prototyping shield. Great display!
Which pins do I need to connect to my Uno r3 to use the SD card?

Also I have many sketches that use the 16 x 2 LCD. How do I modify to use the 1.8" TFT in place of the 16 x 2?

Cheers..B

grimsi
 
Posts: 5
Joined: Wed Aug 28, 2013 4:23 am

Re: 1.8" TFT LCD SD

Post by grimsi »

Hi!

For using the SD Card, you have to connect the Display to Digital Pins 4 and 12.
And dont forget to install the SD-Librarie (Download: https://github.com/adafruit/SD) :)

I dont think that you just can modify your old sketches for the TFT Display, you have to write them new.

Have fun with the new Display
-grimsi

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

Re: 1.8" TFT LCD SD

Post by adafruit_support_rick »

Check out our tutorial on the 1.8" TFT
http://learn.adafruit.com/1-8-tft-display

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: 1.8" TFT LCD SD

Post by adafruit_support_mike »

You probably don't need to start over from scratch, but your life will be easier if you start from a copy of the existing sketches (or fork a new branch if you use git).

You shouldn't need to change you non-display code, but you'll need to replace every lcd.print() with a tft.println() or something similar. There are also more parameters to set up with the TFT, like text size and color.

Here's the text-printing section of the graphics-test sketch for reference:

Code: Select all

unsigned long testText() {
  tft.fillScreen(BLACK);
  unsigned long start = micros();
  tft.setCursor(0, 0);
  tft.setTextColor(WHITE);  tft.setTextSize(1);
  tft.println("Hello World!");
  tft.setTextColor(YELLOW); tft.setTextSize(2);
  tft.println(1234.56);
  tft.setTextColor(RED);    tft.setTextSize(3);
  tft.println(0xDEADBEEF, HEX);
  tft.println();
  tft.setTextColor(GREEN);
  tft.setTextSize(5);
  tft.println("Groop");
  tft.setTextSize(2);
  tft.println("I implore thee,");
  tft.setTextSize(1);
  tft.println("my foonting turlingdromes.");
  tft.println("And hooptiously drangle me");
  tft.println("with crinkly bindlewurdles,");
  tft.println("Or I will rend thee");
  tft.println("in the gobberwarts");
  tft.println("with my blurglecruncheon,");
  tft.println("see if I don't!");
  return micros() - start;
}

User avatar
technerdchris
 
Posts: 46
Joined: Sun Nov 25, 2012 4:08 am

Re: 1.8" TFT LCD SD

Post by technerdchris »

Hey Brewski,

Check out my code here: https://github.com/cacycleworks/Arduino ... inoDRO.ino
Look down around line 383 in the middle of my update() function. That's where I already have all my data figured out and then I want to update the display... that's an example of how I keep accounting of which row I'm on. Also print() vs println() behave differently. If you type exactly the number of characters (or more) that fit on a line, print() will auto wrap. And I believe this feature is an option in the class. println() will wrap to the next line no matter what. Also note the print classes will continue printing below your screen forever; it's up to you to reset the cursor's Y value to be on the screen again.

The Graphics shield changes your reality a little in that there are many lines and there isn't necessarily a "row 1" or "row 2". Or any row. Further, there are two font sizes to complicate things.

Also, I made small changes to Adafruit_GFX (included on that Github repo) to enable me to update just one small field without having to clear the screen. I have a helper function in the ArduinoDRO.ino file called blankPrint() which uses these changes. The point there is that if you have lots of static text but small bits that are dynamic, it's faster to re-write the static text with interspersed blankPrint the text that updates instead of filling the whole screen with black and then writing it all again. I did a youtube of this code in action, too: http://www.youtube.com/watch?v=NwH9ZBMG ... ata_player

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

Return to “Arduino Shields from Adafruit”