Blink LED example for the Multitech mDot. Additionally, has serial comms via USB and RS232.
Fork of mbed-os-example-mbed5-blinky by
Blinks 1 LED while keeping another 2 on. LEDs are on the MTUDK2-ST-MDOT Developer Kit. Has USB and RS232 serial comms.
Revision 31:6daaaf1a1e07, committed 2017-03-22
- Comitter:
- Timsek
- Date:
- Wed Mar 22 18:46:56 2017 +0000
- Parent:
- 30:f5b42453b3f9
- Child:
- 32:7c921089af60
- Commit message:
- Created Multitech mDot version. 2 LEDs on while 1 blinks + serial output.
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed-os.lib | Show annotated file Show diff for this revision Revisions of this file |
--- 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());
+ }
}
--- a/mbed-os.lib Thu Mar 09 11:00:03 2017 +0000 +++ b/mbed-os.lib Wed Mar 22 18:46:56 2017 +0000 @@ -1,1 +1,1 @@ -https://github.com/ARMmbed/mbed-os/#305f5c491e34d86098e9da91b322017549c189ff +https://github.com/ARMmbed/mbed-os/#f4864dc6429e1ff5474111d4e0f6bee36a759b1c
