Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Blink LED 9 With Functions
- // RW Nov 2017
- // Shows how to use Functions subroutines
- // Assgn Constants here
- const unsigned int LED9 = 9; // LED connected to digital pin 9
- void setup()
- {
- pinMode(LED9, OUTPUT); //Sets digital pin 9 as output
- }
- void loop()
- { // Begin Main Loop
- on9(); // Execute on9 Function
- delay(500);
- off9(); // Execute off9 Function
- delay(500);
- } // End of Main Loop
- // * * * * * Subrountines * * * * *
- void on9()
- { // Begin on9 Function
- digitalWrite(LED9, HIGH); // Turns LED9 ON
- return;
- } // End on9 Function
- void off9()
- { // Begin off9 Function
- digitalWrite(LED9, LOW); // Turns LED9 OFF
- return;
- } // End off9 Function
Add Comment
Please, Sign In to add comment