Prof_Carvalho

Untitled

Apr 3rd, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include "mbed.h"
  2.  
  3. DigitalOut myled(LED1);
  4.  
  5. // USB serial (tx, rx)
  6. Serial pc(USBTX, USBRX);
  7.  
  8.  
  9. int main() {
  10.     char dado;
  11.     pc.printf("Comunicacao Serial\n\r");
  12.     while(1) {
  13.         if(pc.readable()){
  14.             dado = pc.getc();
  15.             pc.printf("%c", dado);
  16.         }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment