Sille Van Landschoot
/
racing_robots
Racing Robots Session
Fork of racing_robots by
xbee.h@10:c67825bf5f6b, 2015-06-03 (annotated)
- Committer:
- sillevl
- Date:
- Wed Jun 03 11:28:28 2015 +0000
- Revision:
- 10:c67825bf5f6b
- Parent:
- 8:597ce8a7d34b
initial project
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sillevl | 8:597ce8a7d34b | 1 | #ifndef XBEE_H |
sillevl | 8:597ce8a7d34b | 2 | #define XBEE_H |
sillevl | 8:597ce8a7d34b | 3 | |
sillevl | 8:597ce8a7d34b | 4 | #include "mbed.h" |
sillevl | 8:597ce8a7d34b | 5 | |
sillevl | 8:597ce8a7d34b | 6 | class Xbee{ |
sillevl | 8:597ce8a7d34b | 7 | |
sillevl | 8:597ce8a7d34b | 8 | public: |
sillevl | 8:597ce8a7d34b | 9 | Xbee(PinName tx, PinName rx); |
sillevl | 8:597ce8a7d34b | 10 | int running(); |
sillevl | 8:597ce8a7d34b | 11 | int stopped(); |
sillevl | 8:597ce8a7d34b | 12 | void setCode(int code); |
sillevl | 8:597ce8a7d34b | 13 | int hasCode(); |
sillevl | 8:597ce8a7d34b | 14 | |
sillevl | 8:597ce8a7d34b | 15 | protected: |
sillevl | 8:597ce8a7d34b | 16 | Serial* xbee; |
sillevl | 8:597ce8a7d34b | 17 | void received(); |
sillevl | 8:597ce8a7d34b | 18 | |
sillevl | 8:597ce8a7d34b | 19 | private: |
sillevl | 8:597ce8a7d34b | 20 | int run; |
sillevl | 8:597ce8a7d34b | 21 | int code; |
sillevl | 8:597ce8a7d34b | 22 | |
sillevl | 8:597ce8a7d34b | 23 | int buffer_pos; |
sillevl | 8:597ce8a7d34b | 24 | char buffer[256]; |
sillevl | 8:597ce8a7d34b | 25 | |
sillevl | 8:597ce8a7d34b | 26 | void reset(); |
sillevl | 8:597ce8a7d34b | 27 | DigitalOut* rst; |
sillevl | 8:597ce8a7d34b | 28 | |
sillevl | 8:597ce8a7d34b | 29 | }; |
sillevl | 8:597ce8a7d34b | 30 | |
sillevl | 8:597ce8a7d34b | 31 | |
sillevl | 8:597ce8a7d34b | 32 | #endif |