Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void setup() {
- // put your setup code here, to run once:
- Serial.begin(9600);
- pinMode(13,OUTPUT);
- digitalWrite(13,LOW);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- if(Serial.available()>0)
- {
- char data =Serial.read();
- if(data=='a')
- {
- digitalWrite(13,HIGH);
- }
- else if(data=='b')
- {
- digitalWrite(13,LOW);
- }
- }
- else{
- digitalWrite(13,LOW);
- }
- }
Add Comment
Please, Sign In to add comment