Example of using the Arduino header on the GR-PEACH

Dependencies:   mbed

Files at this revision

API Documentation at this revision

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
--- /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)
+    }
+}
--- /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