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
Revision 0:c1a2bfdd2087, committed 2018-09-25
- Comitter:
- matt495
- Date:
- Tue Sep 25 16:00:40 2018 +0000
- Commit message:
- ME21001 exercise 2;
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 Tue Sep 25 16:00:40 2018 +0000
@@ -0,0 +1,22 @@
+/****************************************************************
+/ Simple program to show basic program structure
+/
+/ The program flashes onboard LED #1 on/off 5 times, one second on and one second off. It then waits 5s before starting again.
+/***************************************************************/
+
+#include "mbed.h"
+
+DigitalOut myled(LED1); // use onboard LED #1
+
+int main() {
+
+ while(1) { // repeat indefinitely
+ for(int i=0; i<5; i++) { // set number of loops to 5
+ myled = 1; // turn on LED #1
+ wait(1.0); // wait 1s
+ myled = 0; // turn off LED #1
+ wait(1.0); // wait 1s
+ }
+ wait (5.0); // wait 5s
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Sep 25 16:00:40 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/e95d10626187 \ No newline at end of file