Serial.println("CONNECTED TO NETWORK"); //Successful connection to wifi
printNetworkInfo();
}
void loop() {
DoorSensor = digitalRead(OpenCloseSensor); //start read from the door sensor
if (DoorSensor == HIGH) {
Serial.println("The door is open");
digitalWrite(2, HIGH); // if door sensor read is high then door is open. Print "The door is open" to console then write information to thing speak channel