This program was created to use in the Heriot Watt Robotics Society Hamilton Circle Electronics workshop.

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
coloursearch
Date:
Thu Nov 09 16:07:30 2017 +0000
Commit message:
Edited the basic blink program for the Hamilton Circle workshop. So that all 4 leds are instantiated and two leds flash in opposite ways

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 Nov 09 16:07:30 2017 +0000
@@ -0,0 +1,19 @@
+#include "mbed.h"
+
+DigitalOut onChipLED1(LED1);
+DigitalOut onChipLED2(LED2);
+DigitalOut onChipLED3(LED3);
+DigitalOut onChipLED4(LED4);
+
+float delay = 0.2;
+
+int main() {
+    while(1) {
+        onChipLED1 = 1;
+        onChipLED2 = 0;
+        wait(delay);
+        onChipLED1 = 0;
+        onChipLED2 = 1;
+        wait(delay);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Nov 09 16:07:30 2017 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/mbed_official/code/mbed/builds/a97add6d7e64
\ No newline at end of file