Project Relay Module
<syntaxhighlight lang="c">
/*
based on Blink, Arduino's "Hello World!" Turns on a Relay on for one second, then off for one second, repeatedly. The Tinkerkit Relay Module is hooked up on O1
This example code is in the public domain. */
- define O0 11
- define O1 10
- define O2 9
- define O3 6
- define O4 5
- define O5 3
- define I0 A0
- define I1 A1
- define I2 A2
- define I3 A3
- define I4 A4
- define I5 A5
void setup() {
// initialize the digital pin as an output. pinMode(O1, OUTPUT);
}
void loop() {
digitalWrite(O1, HIGH); // turn the relay on delay(1000); // wait for a second digitalWrite(O1, LOW); // turn the relayoff delay(1000); // wait for a second
}
</syntaxhighlight>