Juan Salazar / robotic_fish_7

Dependencies:   mbed ESC mbed MODDMA

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 
00002 // NOTE look at the below h files to define whether that control mode is enabled
00003 
00004 #include "mbed.h"
00005 //#include "AcousticControl/AcousticController.h" // also need to define acousticControl in ToneDetector.h
00006 #include "SerialControl/SerialController.h"
00007 //#include "ROSControl/ROSController.h"
00008 
00009 Serial pc(USBTX, USBRX);
00010 
00011 int main()
00012 {
00013     /* ACOUSTIC CONTROL */
00014     //#ifdef acousticControl
00015 //  pc.baud(115200);
00016 //  // Initialize the acoustic controller
00017 //  acousticController.init(&pc); // if no serial object is provided, it will create one on the USB pins
00018 //  // Start the controller
00019 //  // NOTE this is a blocking method, and if infiniteLoopAcoustic is defined it will run forever (or until low battery callback or button board reset command)
00020 //  // It can be stopped by the acousticController.stop() method, but you have to
00021 //  //  control threading here to actually be able to call that
00022 //  //  The acoustic controller hasn't been tested with multi-threading though
00023 //  acousticController.run();
00024 //  #endif
00025 
00026     /* SERIAL CONTROL */
00027     #ifdef serialControl
00028 
00029     pc.baud(115200);
00030     pc.printf("Beginning serial control. \n");
00031     // Initialize the serial controller
00032     serialController.init(NULL, &pc);
00033     // Start the controller
00034     // NOTE this is a blocking method, and if infiniteLoopSerial is defined it will run forever (or until low battery callback or button board reset command)
00035     // It can be stopped by the serialController.stop() method, but you have to
00036     //  control threading here to actually be able to call that
00037     serialController.run();
00038     #endif
00039 
00040     /* ROS CONTROL */
00041     //#ifdef rosControl
00042 //  pc.baud(115200);
00043 //  // Initialize the ROS controller
00044 //  rosController.init(NULL, &pc);
00045 //  // Start the controller
00046 //  // NOTE this is a blocking method, and if infiniteLoopSerial is defined it will run forever (or until low battery callback or button board reset command)
00047 //  // It can be stopped by the rosController.stop() method, but you have to
00048 //  //  control threading here to actually be able to call that
00049 //  rosController.run();
00050 //  #endif
00051 }