Realy Module
hardware
- Arduino Board
- Relay Module Board
wire
- IN 7
code
/**
you may hear ticktock. That's the normally closed contact opened and the normally open contact closed.
*/
const int relayPin = 7; // the "s" of relay module attach to
void setup() {
// put your setup code here, to run once:
pinMode(relayPin, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(relayPin, HIGH); // Close the relay
delay(1000);
digitalWrite(relayPin, LOW); // disconnect the relay;
delay(1000);
}