Created
June 3, 2016 04:03
-
-
Save ShawnHymel/34ca98f17c629810f28dfc8c65ba7613 to your computer and use it in GitHub Desktop.
Sample Arduino code for the Beefcake Relay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Turn the Beefcake Relay on for 2 seconds and off for 2 seconds | |
// | |
// Hardware: | |
// Relay Kit | Arduino | |
// -------------|--------- | |
// 5V | 5V | |
// CTRL | pin 7 | |
// GND | GND | |
// Pins | |
const int RELAY_PIN = 7; | |
void setup() { | |
pinMode(RELAY_PIN, OUTPUT); | |
} | |
void loop() { | |
// Turn the relay on for 2 seconds and off for 2 seconds | |
digitalWrite(RELAY_PIN, HIGH); | |
delay(2000); | |
digitalWrite(RELAY_PIN, LOW); | |
delay(2000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment