mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2024-10-05 20:47:50 -04:00
toggle delay
This commit is contained in:
parent
68be4409ef
commit
fa8ceee44b
@ -32,7 +32,13 @@ void TaskStatusLEDCode (void* parameters) {
|
||||
}
|
||||
|
||||
void TaskLightsAutoCode(void* parameters) {
|
||||
vTaskDelay(pdMS_TO_TICKS(5000));
|
||||
for (;;) {
|
||||
if (light_sensor_reading > 1000)
|
||||
digitalWrite(LIGHTS_PIN, HIGH);
|
||||
else
|
||||
digitalWrite(LIGHTS_PIN, LOW);
|
||||
vTaskDelay(pdMS_TO_TICKS(5000));
|
||||
}
|
||||
}
|
||||
|
||||
void TaskSensorValuesCode (void* parameters) {
|
||||
@ -69,8 +75,8 @@ void setup() {
|
||||
Serial.println("Setting up GPIOs ...");
|
||||
|
||||
pinMode(LED_PIN, OUTPUT);
|
||||
pinMode(LIGHTS_LED, OUTPUT);
|
||||
digitalWrite(LIGHTS_LED, LOW);
|
||||
pinMode(LIGHTS_PIN, OUTPUT);
|
||||
digitalWrite(LIGHTS_PIN, LOW);
|
||||
|
||||
Serial.println("GPIO setup done");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user