Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: TextLCD mbed PID
Diff: usart.cpp
- Revision:
- 5:6604ec9044a0
- Parent:
- 4:536cd493a337
--- a/usart.cpp Mon Mar 17 05:41:07 2014 +0000
+++ b/usart.cpp Mon Mar 17 06:37:37 2014 +0000
@@ -12,6 +12,7 @@
extern Serial xbee;
extern Serial sensor;
extern Serial pc;
+extern DigitalOut myled[4];
extern uint8_t value_ir, ir_num, ir_dis, ball_on;
extern uint8_t ping[4];
@@ -19,12 +20,18 @@
extern uint8_t ir_max, ir_num;
extern int compass;
+int count = 0;
void xbee_tx(){
-
+ xbee.putc(1);
}
void xbee_rx(){
-
+ if(xbee.readable()){
+ count = xbee.getc();
+ } else {
+ count = 0;
+ }
+ //pc.printf("%d\n", count);
}
void micon_rx(){