Created
July 2, 2018 04:38
-
-
Save winhtut/5e9442afc78dbe383ed2d08575e23735 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
void setup() { | |
Serial.begin(9600); | |
pinMode(2,OUTPUT); | |
pinMode(3,OUTPUT); | |
pinMode(4,OUTPUT); | |
pinMode(5,OUTPUT); | |
pinMode(6,OUTPUT); | |
Serial.println("Serial is Ready to use:"); | |
} | |
void loop() { | |
if(Serial.available()){ | |
int data=Serial.read(); | |
Serial.println(data); | |
if(data == 49){ | |
digitalWrite(2,HIGH); | |
digitalWrite(3,HIGH); | |
digitalWrite(4,HIGH); | |
digitalWrite(5,HIGH); | |
digitalWrite(6,HIGH); | |
}else{ | |
digitalWrite(2,LOW); | |
digitalWrite(3,LOW); | |
digitalWrite(4,LOW); | |
digitalWrite(5,LOW); | |
digitalWrite(6,LOW); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment