Guest User

Untitled

a guest
Nov 23rd, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. // Blink LED 9 With Functions
  2. // RW Nov 2017
  3. // Shows how to use Functions subroutines
  4. // Assgn Constants here
  5. const unsigned int LED9 = 9; // LED connected to digital pin 9
  6.  
  7. void setup()
  8. {
  9. pinMode(LED9, OUTPUT); //Sets digital pin 9 as output
  10. }
  11.  
  12. void loop()
  13. { // Begin Main Loop
  14. on9(); // Execute on9 Function
  15. delay(500);
  16. off9(); // Execute off9 Function
  17. delay(500);
  18. } // End of Main Loop
  19.  
  20.  
  21.  
  22. // * * * * * Subrountines * * * * *
  23.  
  24.  
  25. void on9()
  26. { // Begin on9 Function
  27. digitalWrite(LED9, HIGH); // Turns LED9 ON
  28. return;
  29. } // End on9 Function
  30.  
  31.  
  32.  
  33. void off9()
  34. { // Begin off9 Function
  35. digitalWrite(LED9, LOW); // Turns LED9 OFF
  36. return;
  37. } // End off9 Function
Add Comment
Please, Sign In to add comment