Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
532 B
4
Indexable
Never
void setup_Door(void *pvParameter)
{ 
  while(1){
  Firebase.RTDB.getString(&fbdo, "common/DoorStatus");
  DoorStatus = fbdo.stringData();
  if (DoorStatus == "Open" && t == 1)
  {
    digitalWrite(BUZZER_PIN, HIGH);
    delay(100);
    digitalWrite(BUZZER_PIN, LOW);
    actMoCua();
    t = 2;
  }
  else if (DoorStatus == "Close" && t == 2)
  {
    digitalWrite(BUZZER_PIN, HIGH);
    delay(100);
    digitalWrite(BUZZER_PIN, LOW);
    actDongCua();
    t = 1;
  }
  vTaskDelay(pdMS_TO_TICKS(1000));

  }
}