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: MbedJSONValue m3pi
racing_robots.cpp@8:597ce8a7d34b, 2015-06-01 (annotated)
- Committer:
- sillevl
- Date:
- Mon Jun 01 14:47:32 2015 +0000
- Revision:
- 8:597ce8a7d34b
- Parent:
- 4:3743cbfe031b
Added support for start/stop via Xbee
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| pcordemans | 4:3743cbfe031b | 1 | #include "robot_logic.h" |
| dwini | 0:c0ae66a0ec7a | 2 | |
| dwini | 1:43c91152e9ce | 3 | // External functions called from our library |
| dwini | 1:43c91152e9ce | 4 | extern void init(void); |
| dwini | 0:c0ae66a0ec7a | 5 | extern void loop(void); |
| dwini | 0:c0ae66a0ec7a | 6 | |
| dwini | 1:43c91152e9ce | 7 | /* |
| dwini | 1:43c91152e9ce | 8 | * System initialization. |
| dwini | 1:43c91152e9ce | 9 | * Also calls external init() function. |
| dwini | 1:43c91152e9ce | 10 | */ |
| dwini | 0:c0ae66a0ec7a | 11 | void _init(void) { |
| dwini | 0:c0ae66a0ec7a | 12 | // DO our init here |
| dwini | 0:c0ae66a0ec7a | 13 | init(); // Students init |
| sillevl | 8:597ce8a7d34b | 14 | #ifdef XBBE |
| sillevl | 8:597ce8a7d34b | 15 | if(!xbee.hasCode()){ |
| sillevl | 8:597ce8a7d34b | 16 | error("no unique code is set when using Xbee for start/stop"); |
| sillevl | 8:597ce8a7d34b | 17 | } |
| sillevl | 8:597ce8a7d34b | 18 | #endif |
| dwini | 0:c0ae66a0ec7a | 19 | } |
| dwini | 0:c0ae66a0ec7a | 20 | |
| dwini | 1:43c91152e9ce | 21 | /* |
| dwini | 1:43c91152e9ce | 22 | * Entry point. |
| dwini | 1:43c91152e9ce | 23 | * Also calls external loop function. |
| dwini | 1:43c91152e9ce | 24 | */ |
| dwini | 1:43c91152e9ce | 25 | int main (void) { |
| dwini | 0:c0ae66a0ec7a | 26 | // Initialize system |
| dwini | 0:c0ae66a0ec7a | 27 | _init(); |
| dwini | 0:c0ae66a0ec7a | 28 | |
| dwini | 0:c0ae66a0ec7a | 29 | while (true) { |
| dwini | 0:c0ae66a0ec7a | 30 | loop(); // Students loop |
| dwini | 0:c0ae66a0ec7a | 31 | } |
| dwini | 0:c0ae66a0ec7a | 32 | } |
