Arduino UNO not working with Arduino TFT Display
Moderators: adafruit_support_bill, adafruit

Arduino UNO not working with Arduino TFT Display

by benjamins1 on Wed Oct 30, 2013 4:58 am

I'm using an Auduino UNO with an Arduino 1.8" TFT screen. Since the screen is made by arduino and for Arduino, the Arduino software already has example programs set up for the display. However, I cannot get any of the programs to work. They all produce about 3-4 really thick horizontal line on the screen. I replaced the screen, but it didn't help. I can see the screen trying to respond to the pot...like in the 'Graph" example program in Arduino, but the horizintal bard sstill dominate. I have checked the wiring 5 times, and even replaced all wires with new ones.

See attached pics for show of white bars on screen, which happens for all screen test examples I've tried. Note, the pic shows the etch-a-skethc hook up, but I've tried them all.

Do you think my Arduino Board is bad?

Thanks!

Ben
Attachments
100_5912 - Copy.JPG
100_5912 - Copy.JPG (123.98 KiB) Viewed 1435 times
benjamins1
 
Posts: 21
Joined: Mon Oct 07, 2013 1:06 pm

Re: Arduino UNO not working with Arduino TFT Display

by benjamins1 on Wed Oct 30, 2013 5:03 am

Note...I don't have an SD card in the display. Do I need one inserted for propler function??
benjamins1
 
Posts: 21
Joined: Mon Oct 07, 2013 1:06 pm

Re: Arduino UNO not working with Arduino TFT Display

by franklin97355 on Wed Oct 30, 2013 2:44 pm

Please post your code(in [code] tags, your connections and a less blurry picture. Also any messages you get when compiling and loading.
User avatar
franklin97355
 
Posts: 5911
Joined: Mon Apr 21, 2008 2:33 pm

Re: Arduino UNO not working with Arduino TFT Display

by benjamins1 on Wed Oct 30, 2013 3:30 pm

Here you go. In this pic, I used flash, so the horizontal lines don't come out as bright as in rea life, but you can see them. Below are two programs I used directly from the Arduino library that comes automatically downloaded when you use the latest version of Arduion (version 1.0.5). If you want to see them on your own Arduino, just open Arduino and go to File/examples/TFT/Arduino/TFTGraph OR /TFTEtchASketch. These codes are meant to test a TFT. I get NO errors but they don't work. I wire each according to the wiring diagrams on Arduino site. I think the UNO may be bad unless one of my settings is off or something.

TFT Graph wiring:
http://arduino.cc/en/Tutorial/TFTGraph

Etch-a-Sketch wiring
http://arduino.cc/en/Tutorial/TFTEtchASketch


Code for Graph:

Code: Select all | TOGGLE FULL SIZE
/*

 TFT Graph
 
 This example for an Arduino screen reads
 the value of an analog sensor on A0, and
 graphs the values on the screen.
 
 This example code is in the public domain.
 
 Created 15 April 2013 by Scott Fitzgerald
 
 http://arduino.cc/en/Tutorial/TFTGraph
 
 */

#include <TFT.h>  // Arduino LCD library
#include <SPI.h>
 
 // pin definition for the Uno
#define cs   10
#define dc   9
#define rst  8 

// pin definition for the Leonardo
// #define cs   7
// #define dc   0
// #define rst  1

TFT TFTscreen = TFT(cs, dc, rst);

// position of the line on screen
int xPos = 0;

void setup(){
  // initialize the serial port
  Serial.begin(9600);

  // initialize the display
  TFTscreen.begin();

  // clear the screen with a pretty color
  TFTscreen.background(250,16,200);
}

void loop(){
  // read the sensor and map it to the screen height
  int sensor = analogRead(A0);
  int drawHeight = map(sensor,0,1023,0,TFTscreen.height());
 
  // print out the height to the serial monitor
  Serial.println(drawHeight);
 
  // draw a line in a nice color
  TFTscreen.stroke(250,180,10);
  TFTscreen.line(xPos, TFTscreen.height()-drawHeight, xPos, TFTscreen.height());

  // if the graph has reached the screen edge
  // erase the screen and start again
  if (xPos >= 160) {
    xPos = 0;
    TFTscreen.background(250,16,200);
  }
  else {
    // increment the horizontal position:
    xPos++;
  }

  delay(16);
}



Code for Etch-a-sketch:

/*

 TFT EtchASketch
 
 This example for the Arduino screen draws a white point
 on the GLCD based on the values of 2 potentiometers.
 To clear the screen, press a button attached to pin 2.
 
 This example code is in the public domain.
 
 Created 15 April 2013 by Scott Fitzgerald
 
 http://arduino.cc/en/Tutorial/TFTEtchASketch
 
 */
 
#include <TFT.h>  // Arduino LCD library
#include <SPI.h>

// pin definition for the Uno
#define cs   10
#define dc   9
#define rst  8 

// pin definition for the Leonardo
// #define cs   7
// #define dc   0
// #define rst  1

TFT TFTscreen = TFT(cs, dc, rst);

// initial position of the cursor
int xPos = TFTscreen.width()/2;
int yPos = TFTscreen.height()/2;

// pin the erase switch is connected to
int erasePin = 2;

void setup() {
  // declare inputs
  pinMode(erasePin, INPUT);
  // initialize the screen
  TFTscreen.begin();
  // make the background black
  TFTscreen.background(0,0,0);
}

void loop()
{
  // read the potentiometers on A0 and A1
  int xValue = analogRead(A0);
  int yValue = analogRead(A1);

  // map the values and update the position
  xPos = xPos + (map(xValue, 0, 1023, 2, -2));
  yPos = yPos + (map(yValue, 0, 1023, -2, 2));
 
// don't let the point go past the screen edges
  if(xPos > 159){
    (xPos = 159);
  }

  if(xPos < 0){
    (xPos = 0);
  }
  if(yPos > 127){
    (yPos = 127);
  }

  if(yPos < 0){
    (yPos = 0);
  }
 
  // draw the point
  TFTscreen.stroke(255,255,255);
  TFTscreen.point(xPos,yPos);

  // read the value of the pin, and erase the screen if pressed
  if(digitalRead(erasePin) == HIGH){
    TFTscreen.background(0,0,0);
  }

  delay(33);           
}
Last edited by adafruit_support_bill on Sat Nov 09, 2013 7:38 am, edited 1 time in total.
Reason: Please use the 'code' button when submitting code - click 'code' and paste your code between the tags.
benjamins1
 
Posts: 21
Joined: Mon Oct 07, 2013 1:06 pm

Re: Arduino UNO not working with Arduino TFT Display

by benjamins1 on Wed Oct 30, 2013 3:31 pm

Here is the pic.
Attachments
100_5910 - Copy.JPG
100_5910 - Copy.JPG (534.92 KiB) Viewed 1404 times
benjamins1
 
Posts: 21
Joined: Mon Oct 07, 2013 1:06 pm

Re: Arduino UNO not working with Arduino TFT Display

by benjamins1 on Fri Nov 08, 2013 7:59 pm

Hi All,

I found the answer to my question. Someone checked on the Arduino site in a forum in Italian and got the answer. I suppose I could have posted something in the English Arduino site forum, but I got my answer this way. Here was the answer given to me. Here was the answer to the problem I was having.


"The problem is that Arduino changed one of the controllers on the LCD board recently (in all products that use the LCD), and this was incompatible with their LCD library. It’s a shame they didn’t seem to tell anyone.

A fixed TFT Library is included in the nightly build of the 1.5.4 IDE. You can download this here: http://arduino.cc/en/Main/Software#toc4

It seems this problem was only recently discussed in the Arduino Forum (Italian) here: http://forum.arduino.cc//index.php?PHPS ... =192072.45"

Hope this helps!
benjamins1
 
Posts: 21
Joined: Mon Oct 07, 2013 1:06 pm

Re: Arduino UNO not working with Arduino TFT Display

by FingerBuckley on Mon Jun 23, 2014 10:20 pm

Hey! I'm dealing with this same problem. I'm surprised it was so hard to find a mention of the need for updated drivers/libraries. I went ahead and downloaded the most up to date nightly build, but I'm still getting the same white/black horizontal bars. I've restarted the IDE and reuploaded the code. Any hints on what I'm doing wrong?
FingerBuckley
 
Posts: 2
Joined: Mon Jun 23, 2014 10:18 pm

Re: Arduino UNO not working with Arduino TFT Display

by franklin97355 on Tue Jun 24, 2014 12:30 am

Any hints on what I'm doing wrong?
If you're using the Arduino display you should be posting in the Arduino forums http://forum.arduino.cc/
User avatar
franklin97355
 
Posts: 5911
Joined: Mon Apr 21, 2008 2:33 pm