naoki nishii
/
Roomba_Hack
ルンバハック用.
cmd_Receiver.cpp@0:ac1e1657002a, 2016-06-24 (annotated)
- Committer:
- naoki_westwell
- Date:
- Fri Jun 24 07:33:46 2016 +0000
- Revision:
- 0:ac1e1657002a
Roomba Hack
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
naoki_westwell | 0:ac1e1657002a | 1 | #include "mbed.h" |
naoki_westwell | 0:ac1e1657002a | 2 | #include <System_Select.h> |
naoki_westwell | 0:ac1e1657002a | 3 | |
naoki_westwell | 0:ac1e1657002a | 4 | #ifdef CMD_RECEIVER |
naoki_westwell | 0:ac1e1657002a | 5 | |
naoki_westwell | 0:ac1e1657002a | 6 | Serial Device(p13, p14); |
naoki_westwell | 0:ac1e1657002a | 7 | Serial Roomba(p9, p10); |
naoki_westwell | 0:ac1e1657002a | 8 | //Serial pc(USBTX, USBRX); // tx, rx |
naoki_westwell | 0:ac1e1657002a | 9 | |
naoki_westwell | 0:ac1e1657002a | 10 | int main() { |
naoki_westwell | 0:ac1e1657002a | 11 | Device.baud(115200); |
naoki_westwell | 0:ac1e1657002a | 12 | Roomba.baud(115200); |
naoki_westwell | 0:ac1e1657002a | 13 | |
naoki_westwell | 0:ac1e1657002a | 14 | while(1) { |
naoki_westwell | 0:ac1e1657002a | 15 | if(Device.readable()){ |
naoki_westwell | 0:ac1e1657002a | 16 | Roomba.putc(Device.getc()); |
naoki_westwell | 0:ac1e1657002a | 17 | } |
naoki_westwell | 0:ac1e1657002a | 18 | } |
naoki_westwell | 0:ac1e1657002a | 19 | } |
naoki_westwell | 0:ac1e1657002a | 20 | |
naoki_westwell | 0:ac1e1657002a | 21 | #endif |