hello everyone,
I'm trying to use the TFT display ILI9225 using arduino nano. But many errors are coming. Can anyone help me with run this display using arduino nano? Basically i need help in code
Can you share the code and error
What code ?
#include <TFT_22_ILI9225.h>
// Define SPI Pins
#define TFT_RST 9 // Reset
#define TFT_RS 8 // Data/Command
#define TFT_CS 10 // Chip Select
#define TFT_CLK 13 // SPI Clock
#define TFT_SDA 11 // SPI MOSI (Data Out)
// Create TFT instance
TFT_22_ILI9225 tft = TFT_22_ILI9225(TFT_CS, TFT_RST, TFT_RS);
void setup() {
Serial.begin(9600);
Serial.println("Initializing TFT...");
tft.begin(); // Start TFT
tft.setBackgroundColor(COLOR_BLACK);
tft.clear();
tft.setFont(DEFAULT_FONT); // Use default font
tft.drawText(30, 50, "Hello!", COLOR_YELLOW);
tft.drawText(10, 80, "TFT is working!", COLOR_GREEN);
}
void loop() {
// Fill screen with different colors
tft.fillScreen(COLOR_BLUE);
delay(1000);
tft.fillScreen(COLOR_RED);
delay(1000);
}
code for arduino nano to run the tft display
Did the chat gpt made the code for you
yep i want to try to run that display from nano to check whether its working or not so i used chatgpt. But I also tried arduino uno to run the display and its working
with the same code you tried
no i tried different code for uno to run the display
I'll prefer change the code this dummy one right . Go to examples -> TFT_22_ILI9225 -> Basic_Demo it has basic code to work the device nano is not defined in the code .Define the pins and run the code
#elif defined(ARDUINO_AVR_NANO) // Added support for Arduino Nano
#define TFT_RST 8
#define TFT_RS 9
#define TFT_CS 10 // SS
#define TFT_SDI 11 // MOSI
#define TFT_CLK 13 // SCK
#define TFT_LED 3 // 0 if wired to +5V directly
Change the pins according to your connection
i dont get it actually. where i have to go to examples?
File -> examples -> TFT_22_ILI9225 -> Basic_Demo
File is the top left corner
But the code is for arduino arch
the code is for all you need to define the pins that why i added the pins for it.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.