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.
main.cpp
00001 #include "mbed.h" 00002 00003 DigitalOut myled1(LED1); 00004 DigitalOut myled2(LED2); 00005 DigitalOut myled3(LED3); 00006 DigitalOut myled4(LED4); 00007 Serial pc(p9, p10); // tx, rx 00008 00009 int main() { 00010 pc.baud(9600); 00011 pc.printf("Hello from mbed!\n"); 00012 while(1) { 00013 if(pc.readable()) { 00014 char c = pc.getc(); 00015 if(c == '1') { 00016 myled1 = 1; 00017 wait(1.0); 00018 } 00019 if(c == '2') { 00020 myled2 = 1; 00021 wait(1.0); 00022 } 00023 if(c == '3') { 00024 myled3 = 1; 00025 wait(1.0); 00026 } 00027 if(c == '4') { 00028 myled4 = 1; 00029 wait(1.0); 00030 } 00031 pc.putc(c); 00032 myled1=0; 00033 myled2=0; 00034 myled3=0; 00035 myled4=0; 00036 } 00037 } 00038 }
Generated on Sat Jul 23 2022 13:01:22 by
1.7.2