Datasheet

5
delay(1000); // wait for a second
}
3.2 With Arduino
Below is a demo that shows you how to control a Grove - Relay with a Grove - Button. When the button gets pressed, the
relay will close.
// Project Five - Relay Control
//
void setup()
{
pinMode(1, INPUT);
pinMode(2, INPUT);
pinMode(6, OUTPUT);
}
void loop()
{
if (digitalRead(1)==HIGH)
{
digitalWrite(6, HIGH);
delay(100);
}
if (digitalRead(2)==HIGH)
{