Racing Robots Session

Dependencies:   MbedJSONValue m3pi

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers racing_robots.cpp Source File

racing_robots.cpp

00001 #include "robot_logic.h"
00002 
00003 // External functions called from our library
00004 extern void init(void);
00005 extern void loop(void);
00006 
00007 /*
00008  * System initialization.
00009  * Also calls external init() function.
00010  */
00011 void _init(void) {
00012     // DO our init here
00013     init(); // Students init
00014 #ifdef XBBE
00015     if(!xbee.hasCode()){
00016         error("no unique code is set when using Xbee for start/stop");
00017     }
00018 #endif
00019 }
00020 
00021 /*
00022  * Entry point.
00023  * Also calls external loop function.
00024  */
00025 int main (void) {
00026     // Initialize system
00027     _init();
00028 
00029     while (true) {
00030         loop();     // Students loop
00031     }
00032 }