Trying to print a numeric field on display
Is there a better way? A library that encapsulates some of this?
Code:
#include "SPI.h"
#include "ILI9341_t3.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
ILI9341_t3 tft = ILI9341_t3(TFT_CS, TFT_DC);
void setup() {
tft.begin();
tft.fillScreen(ILI9341_BLACK);
tft.setCursor(0, 30);
tft.setTextColor(ILI9341_WHITE); tft.setTextSize(3);
tft.println("Hello World!");
delay(2000);
tft.setCursor(0,30);
tft.setTextColor(ILI9341_BLACK);
tft.println("Hello World!");
}
void loop(void) {
int i;
for(i=0;i<100;i++){
tft.setTextColor(ILI9341_WHITE);
tft.setCursor(0,30);
tft.println(i);
delay(200);
tft.setCursor(0,30);
tft.setTextColor(ILI9341_BLACK);
tft.println(i);
}
}
Is there a better way? A library that encapsulates some of this?