michael kosinski
/
GR-PEACH_ArduinoRelay
Example of using the Arduino header on the GR-PEACH
Revision 0:83f8f2250665, committed 2017-06-29
- Comitter:
- zkimike
- Date:
- Thu Jun 29 17:06:30 2017 +0000
- Commit message:
- GR-PEACH Arduino demo. This demo shows how Arduino pins are mapped to the GR-PEACH.
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 83f8f2250665 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Jun 29 17:06:30 2017 +0000 @@ -0,0 +1,28 @@ +#include "mbed.h" +/* +This demo uses the Arduino Relay Sheild from Seeed. +Here is the link to the shield +http://wiki.seeed.cc/Relay_Shield_v3/ +The Arduino pin mapping is as follows +Ardino Relay +D7 relay 1 +D6 relay 2 +D5 relay 3 +D4 relay 4 +*/ +DigitalOut relay1(D7); +DigitalOut relay2(D6); +DigitalOut relay3(D5); +DigitalOut relay4(D4); + +/* + Toggle the relay with a period of +*/ +int main() { + while(1) { + relay1 = 1; + wait(0.5); // wait 0.5 sec ( 500ms) + relay1 = 0; + wait(0.5); // wait 0.5 sec ( 500ms) + } +}
diff -r 000000000000 -r 83f8f2250665 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Jun 29 17:06:30 2017 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/mbed_official/code/mbed/builds/64910690c574 \ No newline at end of file