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.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 12:8dab8b91a92c
- Parent:
- 4:81cea7a352b0
- Child:
- 13:769319201354
--- a/main.cpp Tue Mar 08 12:40:16 2016 +0000
+++ b/main.cpp Sat May 28 04:11:22 2016 +0000
@@ -1,12 +1,22 @@
-#include "mbed.h"
+#include "mbed.h" // this tells us to load mbed related functions
-DigitalOut myled(LED1);
-
+DigitalOut myled(LED1); // we create a variable 'red', use it as an out port
+
+// this code runs when the microcontroller starts up
int main() {
+
+ // spin in a main loop all the time
while(1) {
+ // turn on LED
myled = 1;
+
+ // wait
wait(0.2);
- myled = 0;
+
+ // YOUR CODE HERE : turn off the LED
+
+
+ // wait again
wait(0.2);
}
}