![](/media/cache/group/Logo-slogen.png.50x50_q85.png)
Grove Relay module, simple example to turn the relay on / off.
Dependencies: mbed
Fork of Seeed_Grove_Relay_Example by
Diff: main.cpp
- Revision:
- 0:7fb1ed08e85a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Sep 05 01:58:41 2014 +0000 @@ -0,0 +1,16 @@ +#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); + } +}