Skip to content

Instantly share code, notes, and snippets.

@e-Gizmo
Last active September 28, 2018 10:59
Show Gist options
  • Save e-Gizmo/f2c57b2ea4cf36f099a8c2df0a75d517 to your computer and use it in GitHub Desktop.
Save e-Gizmo/f2c57b2ea4cf36f099a8c2df0a75d517 to your computer and use it in GitHub Desktop.
/*
PowerRelay Module 12VDC sketch
This is a simple sketch for triggering
the contact of relay. Use digital pin 7
for output.
gizDuino LIN-UNO is an
Arduino UNO Board and IDE
compatible.
Board Select: Arduino UNO
*/
int RELAY = 7;
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin 7 as an output.
pinMode(RELAY, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(RELAY, HIGH); // turn the 7 on (HIGH is the voltage level)
delay(2000); // wait for 2 seconds
digitalWrite(RELAY, LOW); // turn the 7 off by making the voltage LOW
delay(2000); // wait for 2 seconds
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment