#include <WiFi.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#include <screen1setup.h>
#include <Adafruit_NeoPixel.h>
#include <TM1637.h>
//Oring neopixel
#define PIN_NEO_PIXEL 5
#define NUM_PIXELS 20
//Screens TFT
Adafruit_ILI9341 tft1 = Adafruit_ILI9341(TFT_CS, TFT_DC);
Adafruit_ILI9341 tft2 = Adafruit_ILI9341(14, TFT_DC);
Adafruit_NeoPixel NeoPixel(NUM_PIXELS, PIN_NEO_PIXEL, NEO_GRB + NEO_KHZ800);
TM1637 tm16371(12, 39);
TM1637 tm16372(12, 40);
void setup() {
//Start Screens TFT
tft1.begin();
tft1.setRotation(0);
tft1.setTextSize(2);
tft2.begin();
tft2.setRotation(0);
tft2.setTextSize(2);
//End Screens TFT
//Start ORING Neopixel
NeoPixel.begin();
tm16371.init();
tm16371.set(2);
tm16372.init();
tm16372.set(2);
//End Oring Neopixel
}
void loop() {
//Start screens TFT
tft1.fillScreen(ILI9341_BLACK);
tft1.setCursor(0, 0);
tft1.setTextColor(ILI9341_WHITE);
tft1.println("1");
tft2.fillScreen(ILI9341_BLACK);
tft2.setCursor(0, 0);
tft2.setTextColor(ILI9341_WHITE);
tft2.println("2");
//End Screens TFT
//Start Oring Neopixel
NeoPixel.clear(); // set all pixel colors to 'off'. It only takes effect if pixels.show() is called
// turn pixels to green one by one with delay between each pixel
for (int pixel = 0; pixel < NUM_PIXELS; pixel++) { // for each pixel
NeoPixel.setPixelColor(pixel, NeoPixel.Color(0, 255, 0)); // it only takes effect if pixels.show() is called
NeoPixel.show(); // send the updated pixel colors to the NeoPixel hardware.
delay(250); // pause between each pixel
}
//End Oring Neopixel
NeoPixel.clear();
NeoPixel.show(); // send the updated pixel colors to the NeoPixel hardware.
delay(2000); // off time
// turn on all pixels to red at the same time for two seconds
for (int pixel = 0; pixel < NUM_PIXELS; pixel++) { // for each pixel
NeoPixel.setPixelColor(pixel, NeoPixel.Color(255, 0, 0)); // it only takes effect if pixels.show() is called
}
NeoPixel.show(); // send the updated pixel colors to the NeoPixel hardware.
delay(2000); // on time
// turn off all pixels for one seconds
NeoPixel.clear();
NeoPixel.show(); // send the updated pixel colors to the NeoPixel hardware.
delay(2000);
tm16371.display(1, 8);
tm16371.display(2, 8);
tm16371.display(3, 8);
tm16371.display(0, 8);
tm16372.display(1, 8);
tm16372.display(2, 8);
tm16372.display(3, 8);
tm16372.display(0, 8);
}Loading
esp32-s3-devkitc-1
esp32-s3-devkitc-1