Can someone tell me what I'm doing wrong here? Screen is just blank.
- Code:
#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
// For the Adafruit shield, these are the default.
#define TFT_DC 9
#define TFT_CS 10
// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
int lineno=0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600); // open the serial port at 9600 bps
Serial.print("Hello world.\n");
Serial.print("Beginning TFT screen\n");
tft.begin();
Serial.print("TFT screen has begun\n");
}
void loop() {
// put your main code here, to run repeatedly:
tft.fillScreen(ILI9341_WHITE);
yield();
tft.setCursor(lineno, 0);
tft.setTextColor(ILI9341_BLACK); tft.setTextSize(1);
tft.println("Hello World!");
Serial.print("Line"); Serial.print(lineno); Serial.print("\n");
lineno = (lineno+1)%tft.height();
delay(300);
}