Created
September 22, 2019 03:38
-
-
Save Danushka96/1a87fc726d7344bcd87c5ade93d8c91a 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
char data = 0; | |
void setup() { | |
// put your setup code here, to run once: | |
pinMode(12,OUTPUT); | |
Serial.begin(9600); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
if(Serial.available() > 0){ | |
data = Serial.read(); | |
if(data=='1'){ | |
digitalWrite(12,HIGH); | |
}else if(data=='2'){ | |
digitalWrite(12,LOW); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment