Hello,
I'm trying to connect a cheap 2.4" tft screen to a uno which will act as a slave to nodemcu. I've hooked up the screen and connected the A4 and A5 to D1 and D2 pins on nodemcu.
On the product page, they've provided that
That means you can use digital pins 2, 3 and analog 4 and 5.
But when I add
Wire.begin(8);
The screen goes blank.
So, this works:
#include <Wire.h>
#include <SPFD5408_Adafruit_GFX.h> // Core graphics library
#include <SPFD5408_Adafruit_TFTLCD.h> // Hardware-specific library
// LCD Pin
#define LCD_CS A3 // CS
#define LCD_CD A2 // RS
#define LCD_WR A1 // WR
#define LCD_RD A0 // RD
#define LCD_RESET A4 // Optional : otherwise connect to Arduino's reset pin
// Assign human-readable names to some common 16-bit color values:
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
// Init LCD
Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
void setup(void) {
tft.reset();
tft.begin(0x9341);
tft.setRotation(0);
tft.fillScreen(WHITE);
tft.setCursor (0, 20);
tft.setTextSize (4);
tft.setTextColor(RED);
tft.println("ABC123");
}
void loop()
{
delay(100);
}
This does not:
#include <Wire.h>
#include <SPFD5408_Adafruit_GFX.h> // Core graphics library
#include <SPFD5408_Adafruit_TFTLCD.h> // Hardware-specific library
// LCD Pin
#define LCD_CS A3 // CS
#define LCD_CD A2 // RS
#define LCD_WR A1 // WR
#define LCD_RD A0 // RD
#define LCD_RESET A4 // Optional : otherwise connect to Arduino's reset pin
// Assign human-readable names to some common 16-bit color values:
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
// Init LCD
Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
void setup(void) {
Wire.begin(8);
tft.reset();
tft.begin(0x9341);
tft.setRotation(0);
tft.fillScreen(WHITE);
tft.setCursor (0, 20);
tft.setTextSize (4);
tft.setTextColor(RED);
tft.println("ABC123");
}
void loop()
{
delay(100);
}
As the screen allows those pins to be used, what am I missing?