Guest User

Untitled

a guest
Feb 25th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. void setup() {
  2. // put your setup code here, to run once:
  3. Serial.begin(9600);
  4. pinMode(13,OUTPUT);
  5. digitalWrite(13,LOW);
  6. }
  7.  
  8. void loop() {
  9. // put your main code here, to run repeatedly:
  10. if(Serial.available()>0)
  11. {
  12. char data =Serial.read();
  13. if(data=='a')
  14. {
  15. digitalWrite(13,HIGH);
  16. }
  17. else if(data=='b')
  18. {
  19. digitalWrite(13,LOW);
  20. }
  21. }
  22. else{
  23. digitalWrite(13,LOW);
  24. }
  25. }
Add Comment
Please, Sign In to add comment