ROS to mbed serial communication
main.cpp
- Committer:
- tknara
- Date:
- 2018-11-09
- Revision:
- 0:855bc4d85b0e
File content as of revision 0:855bc4d85b0e:
#include "mbed.h"
Serial pc(USBTX,USBRX);
DigitalOut myled(PB_3);
void pc_rx_callback(){
pc.attach(pc_rx_callback, Serial::RxIrq);
//pc.printf("%s\r\n",pc.getc());
}
int main() {
pc.baud(115200);
pc.attach(pc_rx_callback, Serial::RxIrq);
while(1) {
myled = 1;
wait(0.5);
}
}