This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | Next revision Both sides next revision | ||
|
digispark:tutorials:relay [2013/03/29 06:55] PeterMortensen [Product Description:] Copy edited. |
digispark:tutorials:relay [2013/03/29 06:57] PeterMortensen [Programming:] Copy edited [8]. Replaced TABs with spaces to ease formatting, etc. |
||
|---|---|---|---|
| Line 68: | Line 68: | ||
| <code> | <code> | ||
| - | void setup() { | + | void setup() { |
| - | // initialize the relay pin as output | + | // Initialize the relay pin as output |
| - | pinMode(5, OUTPUT); | + | pinMode(5, OUTPUT); |
| } | } | ||
| void loop() { | void loop() { | ||
| - | digitalWrite(5, HIGH); // turn the relay on | + | digitalWrite(5, HIGH); // Turn the relay on |
| - | delay(1000); // wait for a second | + | delay(1000); // Wait for a second |
| - | digitalWrite(5, LOW); // turn the relay off | + | digitalWrite(5, LOW); // Turn the relay off |
| - | delay(1000); // wait for a second | + | delay(1000); // Wait for a second |
| } | } | ||
| </code> | </code> | ||
| + | |||