![](/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
Revision 0:7fb1ed08e85a, committed 2014-09-05
- Comitter:
- mbedAustin
- Date:
- Fri Sep 05 01:58:41 2014 +0000
- Commit message:
- Seeed Grove Relay example application, turns relay on / off. Can see the LED blink accordingly.
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 7fb1ed08e85a main.cpp --- /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); + } +}
diff -r 000000000000 -r 7fb1ed08e85a mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Sep 05 01:58:41 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9327015d4013 \ No newline at end of file