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.
Diff: main.cpp
- Revision:
- 0:82e77230d7bb
diff -r 000000000000 -r 82e77230d7bb main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sat Sep 24 14:57:19 2016 +0000
@@ -0,0 +1,27 @@
+/**************************************************************
+/ Simple program program to show basic program structure
+/
+/ The program flashes attached LEDs for 1 second sequentially and repeats indeffinitely.
+/
+/**************************************************************/
+
+#include "mbed.h"
+
+DigitalOut yelLED(p22); // name attached LED p22
+DigitalOut greLED(p23); // name attached LED p23
+DigitalOut redLED(p24); // name attached LED p24
+int main() {
+ while(1) { // repeat indefinitely
+ yelLED = 1; // activates yellow LED
+ wait(1); // pauses for a second
+ yelLED = 0; // deactivates yellow LED
+ wait(1); // pauses for a second
+ greLED = 1; // activates green LED
+ wait(1); // pauses for a second
+ greLED = 0; // deactivates green LED
+ wait(1); // pauses for a second
+ redLED = 1; // activates red LED
+ wait(1); // pauses for a second
+ redLED = 0; // deactivates red LED
+ }
+}
\ No newline at end of file