Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 0:2eb8dcd27e93, committed 2017-12-17
- Comitter:
- abuchan
- Date:
- Sun Dec 17 01:14:16 2017 +0000
- Child:
- 1:595758ad1a42
- Commit message:
- Initial marching blink test
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed-dev.lib | 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 Sun Dec 17 01:14:16 2017 +0000
@@ -0,0 +1,33 @@
+#include "mbed.h"
+
+DigitalOut myled(LED1);
+
+#define N_BLINK 2
+
+#define N_LEDS 18
+
+DigitalOut leds[N_LEDS] = {D1, A4, D4, A0, A6, A2, D8, D0, A3, D5, D10, D6, A5, D9, D3, D2, D7, A1};
+
+int main() {
+ int count = 0;
+ while(1) {
+ for (int i = 0; i < N_LEDS; i++) {
+ if (i == count) {
+ leds[i] = 0;
+ } else {
+ leds[i] = 1;
+ }
+ }
+
+ if (++count == N_LEDS)
+ count = 0;
+
+ for (int i = 0; i < N_BLINK; i++) {
+ myled = 1; // LED is ON
+ wait(0.1); // 200 ms
+ myled = 0; // LED is OFF
+ wait(0.1); // 200 ms
+ }
+ wait(0.5); // 1 sec
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-dev.lib Sun Dec 17 01:14:16 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed-dev/#b0033dcd6934