Created
May 11, 2021 20:54
-
-
Save developerfromjokela/4cb5be6c53c55ef3efe1414e4dd9bbee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Servo.h> | |
void setup() { | |
// put your setup code here, to run once: | |
Serial.begin(9600); | |
pinMode(LED_BUILTIN, OUTPUT); | |
digitalWrite(LED_BUILTIN, HIGH); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
while(Serial.available()>0){ | |
String text = Serial.readString(); | |
if (text == "open_door") { | |
digitalWrite(LED_BUILTIN, LOW); | |
} else if (text == "close_door") { | |
digitalWrite(LED_BUILTIN, HIGH); | |
} | |
} | |
delay(10); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment