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
main.cpp
00001 #include "mbed.h" 00002 00003 00004 Serial rs232(PA_2, PA_3); //9600 baud rate 00005 Serial mypc(USBTX, USBRX); //9600 baud rate 00006 00007 DigitalOut led1(PA_0); // MTUDK2-ST-MDOT Developer Kit D3 00008 DigitalOut led2(PA_1); // MTUDK2-ST-MDOT Developer Kit D6 00009 DigitalOut led3(PA_11); // MTUDK2-ST-MDOT Developer Kit D7 00010 00011 00012 // main() runs in its own thread in the OS 00013 int main() { 00014 00015 led2 = 0; // The MTUDK2-ST-MDOT has a 74LCX14MTC before the LEDs, which inverts therefore 0 = on 00016 led3 = 0; 00017 00018 00019 while (true) { 00020 led1 = !led1; 00021 wait(2); //2s 00022 00023 rs232.printf("Serial:LED is now %d\r\n", led1.read()); 00024 mypc.printf("USB:I'm working\r\n"); 00025 00026 rs232.putc(rs232.getc()); //wait for char from rs232 and echo it back 00027 } 00028 } 00029
Generated on Sun Jul 17 2022 22:10:59 by
1.7.2
