mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2024-10-05 20:47:50 -04:00
.
This commit is contained in:
parent
7d4e6d0c1c
commit
1752a64b63
@ -34,13 +34,14 @@ void TaskStatusLEDCode (void* parameters) {
|
||||
void TaskLightsAutoCode(void* parameters) {
|
||||
for (;;) {
|
||||
// If lighting is dark, then turn lights ON and increase delay interval
|
||||
// Swap HIGH with LOW since we're using NPN transistor to control relay.
|
||||
if (light_sensor_reading > 1500) {
|
||||
digitalWrite(LIGHTS_PIN, HIGH);
|
||||
digitalWrite(LIGHTS_PIN, LOW);
|
||||
vTaskDelay(pdMS_TO_TICKS(10000));
|
||||
}
|
||||
// If lighting is bright, then turn lights OFF and decrease delay interval
|
||||
else {
|
||||
digitalWrite(LIGHTS_PIN, LOW);
|
||||
digitalWrite(LIGHTS_PIN, HIGH);
|
||||
vTaskDelay(pdMS_TO_TICKS(1000));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user