I have one of the cheap chinese tft's working with a nano using either the Adafruit 9340 or 9341library. I've been trying to get it to work on the NodeMCU, with little effect. Lots of errors at compile. Does anyone have a link to a suitable library? There are a number of demos on the web showing its use with nodeMCU, but I can't get any code to compile.
My initial errors are:
C:\Users\e11355\OneDrive\Arduino\libraries\Adafruit_ILI9340-master\Adafruit_ILI9340.cpp: In member function 'void Adafruit_ILI9340::spiwrite(uint8_t)':
C:\Users\e11355\OneDrive\Arduino\libraries\Adafruit_ILI9340-master\Adafruit_ILI9340.cpp:85:38: error: 'SET_BIT' was not declared in this scope
SET_BIT(mosiport, mosipinmask);
My code is
#include <ESP8266WiFi.h>
#include "SPI.h"
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9340.h>
#define tft_sclk 14
#define tft_miso 12
#define tft_mosi 13
#define tft_cs 5
#define tft_dc 2
#define tft_rst 1
Adafruit_ILI9340 tft = Adafruit_ILI9340(tft_cs, tft_dc,tft_rst);
void setup() {
Serial.begin(115200);
Serial.println("ILI9340 Test!");
tft.begin();
tft.setRotation(1);
tft.fillScreen(ILI9340_WHITE);
tft.setTextColor(ILI9340_BLACK);
tft.setTextSize(2);
tft.setCursor(20,46);
tft.println("Hello World!");
}
void loop() {
while(1)
{
;
}
}