Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Arduino.h>
- #include <Adafruit_Sensor.h>
- #include <DHT.h>
- #include <Adafruit_GFX.h>
- #include <Adafruit_ST7735.h>
- #include <SPI.h>
- #define TFT_CS 7
- #define TFT_RST 0
- #define TFT_DC 1
- #define TFT_LED 3
- const uint16_t Color_Black = 0x0000;
- const uint16_t Color_Blue = 0x001F;
- const uint16_t Color_Red = 0xF800;
- const uint16_t Color_Green = 0x07E0;
- const uint16_t Color_Cyan = 0x07FF;
- const uint16_t Color_Magenta = 0xF81F;
- const uint16_t Color_Yellow = 0xFFE0;
- const uint16_t Color_White = 0xFFFF;
- Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
- void setup() {
- Serial.begin(115200);
- dht.begin();
- Serial.println("DHT22 sensor initialized");
- pinMode(TFT_LED, OUTPUT);
- analogWrite(TFT_LED, 200);
- tft.initR(INITR_144GREENTAB);
- Serial.println("TFT display initialized");
- tft.setFont();
- tft.fillScreen(Color_White);
- }
- void loop() {
- delay(2000);
- Serial.println("Starting loop");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement