The effect produced tft.println(str); } WiFi and NTP const char *ssid = "your own WiFi"; //WiFi account const char *password = "your own WiFi password"; //WiFi password WiFiUDP ntpUDP; NTPClient timeClient(ntpUDP,"cn.pool.ntp.org"); //NTP server address void get_wifi() { // Connect to the network WiFi.begin(ssid, password); //Wait for WiFi connection while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.println("WiFi connected"); //Connection successful Serial.print("IP address: "); //Print IP address Serial.println(WiFi.localIP()); } timeClient.begin(); // Set the offset time (in seconds) to adjust the time zone, for example: // GMT +1 = 3600 // GMT +8 = 28800 timeClient.setTimeOffset(28800); SHT4x Temperature and Humidity Sensor // SHT40 Temperature and Humidity Sensor Configuration and Initialization Code #define SHT4X_SDA_PIN 21 #define SHT4X_SCL_PIN 22 Adafruit_SHT4x sht4 = Adafruit_SHT4x(); void SHT4x_Init() { Wire.begin(SHT4X_SDA_PIN, SHT4X_SCL_PIN); if (!sht4.begin()) { Serial.println("Couldn't find SHT4x");//Try initializing the SHT4x sensor. If it fails, print the error message and enter an infinite loop while (1) delay(1); } Serial.println("Found SHT4x sensor"); Serial.print("Serial number 0x"); Serial.println(sht4.readSerial(), HEX); sht4.setPrecision(SHT4X_HIGH_PRECISION);//Set the sensor precision switch (sht4.getPrecision()) { case SHT4X_HIGH_PRECISION: Serial.println("High precision"); break; case SHT4X_MED_PRECISION: Serial.println("Med precision"); break; case SHT4X_LOW_PRECISION: Serial.println("Low precision"); break; } sht4.setHeater(SHT4X_NO_HEATER);//Disable the sensor's heater function. switch (sht4.getHeater()) { case SHT4X_NO_HEATER: Serial.println("No heater"); break; case SHT4X_HIGH_HEATER_1S: Serial.println("High heat for 1 second"); break; case SHT4X_HIGH_HEATER_100MS: Serial.println("High heat for 0.1 second"); break; case SHT4X_MED_HEATER_1S: Serial.println("Medium heat for 1 second"); break; case SHT4X_MED_HEATER_100MS: Serial.println("Medium heat for 0.1 second"); break; case SHT4X_LOW_HEATER_1S: Serial.println("Low heat for 1 second"); break; case SHT4X_LOW_HEATER_100MS: Serial.println("Low heat for 0.1 second"); break; } }
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet