Grove Relay module, simple example to turn the relay on / off.

Dependencies:   mbed

Fork of Seeed_Grove_Relay_Example by Austin Blackstone

main.cpp

Committer:
mbedAustin
Date:
2014-09-05
Revision:
0:7fb1ed08e85a

File content as of revision 0:7fb1ed08e85a:

#include "mbed.h"

DigitalOut relay(D6);
int on = 1,off = 0;
int main()
{

    // Loop forever, relay on/ off for 1 second each
    // LED on relay will blink on / off 
    while(1) {
        relay = on;
        wait(1);
        relay = off;
        wait(1);
    }
}