Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "mbed.h"
- Serial pc(USBTX, USBRX);
- DigitalOut myled(LED1);
- char serialValue;
- int main() {
- while(1) {
- if(pc.readable()) {
- serialValue = pc.getc();
- pc.putc(serialValue);
- if (serialValue == '1') {
- myled = 1;
- }
- else {
- myled = 0;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment