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.
Fork of mbed-os-example-mbed5-blinky by
Diff: main.cpp
- Revision:
- 31:6daaaf1a1e07
- Parent:
- 29:0b58d21e87d6
- Child:
- 32:7c921089af60
diff -r f5b42453b3f9 -r 6daaaf1a1e07 main.cpp
--- a/main.cpp Thu Mar 09 11:00:03 2017 +0000
+++ b/main.cpp Wed Mar 22 18:46:56 2017 +0000
@@ -1,12 +1,25 @@
#include "mbed.h"
-DigitalOut led1(LED1);
+
+Serial pc(USBTX, USBRX); //9600 baud rate
+
+
+DigitalOut led1(PA_0); // MTUDK2-ST-MDOT Developer Kit D3
+DigitalOut led2(PA_1); // MTUDK2-ST-MDOT Developer Kit D6
+DigitalOut led3(PA_11); // MTUDK2-ST-MDOT Developer Kit D7
+
// main() runs in its own thread in the OS
int main() {
+
+ led2 = 0; // The MTUDK2-ST-MDOT has a 74LCX14MTC before the LEDs, which inverts therefore 0 = on
+ led3 = 0;
+
+
while (true) {
led1 = !led1;
- wait(0.5);
- }
+ wait(2); //2s
+ pc.printf("Blink! LED is now %d\r\n", led1.read());
+ }
}
