-
-
Save ArshSekhon/adfdec29cef8f6a51cda90735c3201bf 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
#define LED_PIN 13 | |
int ledStatus=0; | |
void setup() { | |
pinMode(LED_PIN, OUTPUT); | |
digitalWrite(LED_PIN, LOW); | |
Serial3.begin(9600); | |
} | |
void loop() { | |
if (Serial3.available() > 0){ //if the user has entered something in the serial monitor | |
ledStatus = Serial3.parseInt(); | |
if(ledStatus==0) | |
digitalWrite(LED_PIN, LOW); | |
else if(ledStatus==1) | |
digitalWrite(LED_PIN, HIGH); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment