Skip to content

Instantly share code, notes, and snippets.

@developerfromjokela
Created May 11, 2021 20:54
Show Gist options
  • Save developerfromjokela/4cb5be6c53c55ef3efe1414e4dd9bbee to your computer and use it in GitHub Desktop.
Save developerfromjokela/4cb5be6c53c55ef3efe1414e4dd9bbee to your computer and use it in GitHub Desktop.
#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