Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Adafruit_GFX.h> // Core graphics library
- #include <Adafruit_ST7735.h> // Hardware-specific library for ST7735
- // Define the pins for the display (change these to match your wiring)
- #define TFT_RST 9
- #define TFT_DC 8
- #define TFT_CS 10
- // Create an instance of the Adafruit_ST7735 class
- Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
- void setup() {
- // Initialize the display
- tft.initR(INITR_BLACKTAB); // You may need to adjust the initialization type
- // Set the rotation (you may need to adjust this to match your display orientation)
- tft.setRotation(1); // Use 0, 1, 2, or 3 depending on your needs
- // Clear the screen and set text color
- tft.fillScreen(ST77XX_BLACK);
- tft.setTextColor(ST77XX_WHITE);
- // Set the font size
- tft.setTextSize(2);
- }
- void loop() {
- // Clear the screen
- tft.fillScreen(ST77XX_BLACK);
- // Display some text
- tft.setCursor(10, 10);
- tft.print("Hello, Arduino!");
- delay(2000); // Delay for 2 seconds
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement