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
- Committer:
- yeongsookim
- Date:
- 2019-10-06
- Revision:
- 0:b607e9d67e56
File content as of revision 0:b607e9d67e56:
#include "mbed.h" Serial pc(USBTX, USBRX); // tx, rx PwmOut led1(LED1); PwmOut led2(LED2); PwmOut led3(LED3); PwmOut led4(LED4); int main() { pc.printf("Press '1' On LED1\n"); pc.printf("Press '2' On LED2\n"); pc.printf("Press '3' On LED3\n"); pc.printf("Press '4' On LED4\n"); pc.printf("Press '0' Off All LED\n"); while(1) { pc.printf("Waiting Request\n"); char c = pc.getc(); pc.printf("Complete Response\n"); if(c == '1') led1 = 1; if(c == '2') led2 = 1; if(c == '3') led3 = 1; if(c == '4') led4 = 1; if(c == '0') { led1 = 0; led2 = 0; led3 = 0; led4 = 0; } } }