Download esp32/level2/humidity_sensor/src/main_esp.cpp from eunzee/PCEval: direct link, hf CLI and curl.
- Browser
- Download file 530 Bytes
-
https://huggingface.co/datasets/eunzee/PCEval/resolve/main/esp32/level2/humidity_sensor/src/main_esp.cpp
- Command line
-
hf download hf://datasets/eunzee/PCEval/esp32/level2/humidity_sensor/src/main_esp.cpp
-
curl -L -o main_esp.cpp https://huggingface.co/datasets/eunzee/PCEval/resolve/main/esp32/level2/humidity_sensor/src/main_esp.cpp
530 Bytes
| /** | |
| Read humidity sensor value and compare with the input value | |
| 03 MAY 2025 by Blind Author | |
| */ | |
| DHT dht(DHTPIN, DHTTYPE); | |
| float threshold = 50.0; | |
| void setup() { | |
| Serial.begin(9600); | |
| dht.begin(); | |
| } | |
| void loop() { | |
| float humidity = dht.readHumidity(); | |
| if (humidity < threshold) { | |
| Serial.println("Humidity is below the threshold"); | |
| } else { | |
| Serial.println("Humidity is above the threshold"); | |
| } | |
| delay(1000); | |
| } |