Öffnet und schließt den externen Stromkreis (an den beiden freien Kabeln) anhand des Relais im Viersekundentakt.
/*
* Control external curcuit with a relais
* Switches on after 4 sec, then off after 4 sec.
*/
int relaisPin = 2; // choose pin 2 for the relais
void setup() {
pinMode(relaisPin, OUTPUT);
}
void loop() {
digitalWrite(relaisPin, HIGH); // switch on external curcuit
delay(4000); // wait for 4000 ms
digitalWrite(relaisPin, LOW); // switch off external curcuit
delay(4000); // wait for 4000 ms
}
