I am lerning to use my arduino, and so far the software works. But i can't find out what is wrong when it comes to my screen.
I use the graf in example in software 1.5.7
I can see the serial monitor is running the numbers for the pins
But the screen is just black
It might just be a wrong pin setting?
my code is
#include <TFT.h>
#include <SPI.h>
#define cs 7
#define dc 0
#define rst 1
TFT TFTscreen = TFT(cs, dc, rst);
int xPos = 0;
void setup() {
Serial.begin(9600);
TFTscreen.begin();
TFTscreen.background(250, 16, 200);
}
void loop() {
int sensor = analogRead(A0);
int drawHeight = map(sensor, 0, 1023, 0, TFTscreen.height());
Serial.println(drawHeight);
TFTscreen.stroke(250, 180, 10);
TFTscreen.line(xPos, TFTscreen.height() - drawHeight, xPos, TFTscreen.height());
if (xPos >= 160) {
xPos = 0;
TFTscreen.background(250, 16, 200);
}
else {
xPos++;
}
delay(16);
}
please help
Regards Daniel