relay exmaples

Fork of Hexi_Click_Relay_Example by Hexiwear

Files at this revision

API Documentation at this revision

Comitter:
GregC
Date:
Wed Aug 24 22:27:49 2016 +0000
Child:
1:489e49494755
Commit message:
Click Relay example for Hexiwear

Changed in this revision

.gitignore Show annotated file Show diff for this revision Revisions of this file
img/uvision.png Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.gitignore	Wed Aug 24 22:27:49 2016 +0000
@@ -0,0 +1,4 @@
+.build
+.mbed
+projectfiles
+*.py*
Binary file img/uvision.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Aug 24 22:27:49 2016 +0000
@@ -0,0 +1,20 @@
+#include "mbed.h"
+
+DigitalOut relay1(PTA10);
+DigitalOut relay2(PTC4);
+
+// main() runs in its own thread in the OS
+// (note the calls to Thread::wait below for delays)
+int main() {
+    while (true) {
+        relay1 = 1;
+        Thread::wait(500);
+        relay1 = 0;
+        Thread::wait(500);
+        relay2 = 1;
+        Thread::wait(500);
+        relay2 = 0;
+        Thread::wait(500);
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Wed Aug 24 22:27:49 2016 +0000
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#d2202045ac8f2fc63836a5b7131c9b56ac58f06a