Advertisement
Guest User

리명박개새끼

a guest
Nov 1st, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. /*
  2. Blink
  3. Turns on an LED on for one second, then off for one second, repeatedly.
  4.  
  5. Most Arduinos have an on-board LED you can control. On the Uno and
  6. Leonardo, it is attached to digital pin 13. If you're unsure what
  7. pin the on-board LED is connected to on your Arduino model, check
  8. the documentation at http://arduino.cc
  9.  
  10. This example code is in the public domain.
  11.  
  12. modified 8 May 2014
  13. by Scott Fitzgerald
  14. */
  15.  
  16. int serialA=0;
  17. // the setup function runs once when you press reset or power the board
  18. void setup() {
  19. int i;
  20. // initialize digital pin 13 as an output.
  21. for(i=11;i<14;i++)
  22. pinMode(i, OUTPUT);
  23. }
  24.  
  25. // the loop function runs over and over again forever
  26. void loop() {
  27. int i;
  28. for(i=13;i>10;i--)
  29. {
  30. digitalWrite(i, HIGH);
  31. delay(314);
  32. }
  33. for(i=11;i<14;i++)
  34. {
  35. digitalWrite(i,LOW);
  36. delay(314);
  37.  
  38. }
  39. void serialEvent()
  40. {
  41. serialA=Serial.read();
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement