#include #include //#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include //#include "sntp.h" #include "time.h" //Configuration const int panelResX = 64; // Number of pixels wide of each INDIVIDUAL panel module. const int panelResY = 32; // Number of pixels tall of each INDIVIDUAL panel module. const int panel_chain = 1; // Total number of panels chained one to another //bool secondChanged(); #define myTZ_POSIX TZ= EST -5 EDT ,M3 .5 .0 /2 ,m10 .5 .0 /3 //bool enableHeater = false; //uint8_t loopCnt = 0; //Adafruit_SHT31 sht31 = Adafruit_SHT31(); char ssid[] = "PZRG4"; char pass[] = "erica610"; //float Ct = sht31.readTemperature(); //float Ih = sht31.readHumidity(); //float It = (Ct*1.8)+32; MatrixPanel_I2S_DMA *dma_display = nullptr; Timezone myTZ; uint16_t myBLACK = dma_display->color565(0, 0, 0); uint16_t myWHITE = dma_display->color565(255, 255, 255); uint16_t myRED = dma_display->color565(255, 0, 0); uint16_t myGREEN = dma_display->color565(0, 255, 0); uint16_t myBLUE = dma_display->color565(0, 0, 255); const int defaultBrightness = (40*255)/100; // full (100%) brightness int16_t xOne, yOne; uint16_t w, h; void displaySetup() { HUB75_I2S_CFG mxconfig( panelResX, // module width panelResY, // module height panel_chain // Chain length ); // If you are using a 64x64 matrix you need to pass a value for the E pin // The trinity connects GPIO 18 to E. // This can be commented out for any smaller displays (but should work fine with it) //mxconfig.gpio.e = 18; // May or may not be needed depending on your matrix // Example of what needing it looks like: // https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-I2S-DMA/issues/134#issuecomment-866367216 mxconfig.clkphase = false; // Some matrix panels use different ICs for driving them and some of them have strange quirks. // If the display is not working right, try this. //mxconfig.driver = HUB75_I2S_CFG::FM6126A; dma_display = new MatrixPanel_I2S_DMA(mxconfig); dma_display->begin(); } void setup() { Serial.begin(115200); WiFi.begin("PZRG4", "erica610"); waitForSync(); while (WiFi.status() != WL_CONNECTED) { Serial.print("."); delay(1000); } Serial.print("Attempting to connect to Network named: "); Serial.println(ssid); Serial.println(""); IPAddress ip = WiFi.localIP(); Serial.print("IP Address: "); Serial.println(ip); // Set NTP polling interval to 60 seconds. Way too often, but good for demonstration purposes. setInterval(60); // Make ezTime show us what it is doing //setDebug(INFO); myTZ.setLocation(F("America/New_York")); Serial.println (F("New York: ")); Serial.println (myTZ.dateTime ("j-m-y h:i:s A T")); displaySetup(); dma_display->clearScreen(); dma_display->fillScreen(myBLACK); dma_display->setTextSize(1); // size == 8 pixels high dma_display->setTextWrap(false); // N.B!! Don't wrap at end of line // Pointers to this variable will be passed into getTextBounds, // they will be updated from inside the method dma_display->getTextBounds("1234567890", 0, 0, &xOne, &yOne, &w, &h); int xPosition = dma_display->width() / 2 - w / 2 + 1; dma_display->setCursor(xPosition, 0); dma_display->setTextColor(myBLUE); dma_display->print("33f 45%"); dma_display->getTextBounds("72F 50%", 0, 0, &xOne, &yOne, &w, &h); xPosition = dma_display->width() / 2 - w / 2 + 1; dma_display->setCursor(xPosition, 8); dma_display->setTextColor(myGREEN); dma_display->print("73f 45%"); dma_display->getTextBounds("11:15:11am", 0, 0, &xOne, &yOne, &w, &h); xPosition = dma_display->width() / 2 - w / 2 + 1; dma_display->setCursor(xPosition, 16); dma_display->setTextColor(myWHITE); dma_display->print(myTZ.dateTime ("g:i:sa")); dma_display->getTextBounds("02-21-22", 0, 0, &xOne, &yOne, &w, &h); xPosition = dma_display->width() / 2 - w / 2 + 1; dma_display->setCursor(xPosition, 24); dma_display->setTextColor(myRED); dma_display->print(myTZ.dateTime ("m-j-y")); //dma_display->fillScreen(myBLACK); //delay(1000); } void loop() { void events();{ delay(1000); }