User Tools

Site Tools


digispark:tutorials:relay

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

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>​
 +
digispark/tutorials/relay.txt · Last modified: 2016/06/09 12:03 (external edit)