Skip to content

Instantly share code, notes, and snippets.

@surinoel
Created July 8, 2019 05:47
Show Gist options
  • Save surinoel/27fa998ff605a36231f4d48f267d3088 to your computer and use it in GitHub Desktop.
Save surinoel/27fa998ff605a36231f4d48f267d3088 to your computer and use it in GitHub Desktop.
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(13, OUTPUT);
}
void loop() {
}
void serialEvent(void)
{
char data;
data = Serial.read();
if(data == 'o') {
digitalWrite(13, 1);
}
else if(data == 'x') {
digitalWrite(13, 0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment