Guest User

Untitled

a guest
Dec 9th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include "mbed.h"
  2.  
  3. Serial pc(USBTX, USBRX);
  4. DigitalOut myled(LED1);
  5.  
  6. char serialValue;
  7.  
  8. int main() {
  9. while(1) {
  10. if(pc.readable()) {
  11. serialValue = pc.getc();
  12. pc.putc(serialValue);
  13. if (serialValue == '1') {
  14. myled = 1;
  15. }
  16. else {
  17. myled = 0;
  18. }
  19. }
  20. }
  21. }
Add Comment
Please, Sign In to add comment