![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
RC-car remotely controlled from a computer. A demonstration of the power of Pytelemetry/telemetry. MIT Licensing.
Dependencies: BufferedSerial FRDM-TFC mbed telemetry
Example of the 'Telemetry' library, a portable communication library for embedded devices. The PC-side of this code is hosted a github.com/Overdrivr/telemetry-examples
This code uses the car from the Freescale Cup competition initially dedicated to be a line-following racing car, and turns it into a full-blown radio-controlled car.
It is using a Bluetooth serial module to provide wireless connectivity. See the repository at github.com/Overdrivr/telemetry-examples for complete instructions on wiring everthing together.
Repo : TO BE DONE
Diff: main.cpp
- Revision:
- 2:74d5233b6284
- Parent:
- 1:5a07069e17b6
--- a/main.cpp Mon Feb 22 21:24:52 2016 +0000 +++ b/main.cpp Wed Mar 09 15:45:28 2016 +0000 @@ -1,6 +1,6 @@ #include "mbed.h" -#include "FRDM-TFC/TFC.h" -#include "telemetry/Telemetry.h" +#include "TFC.h" +#include "Telemetry.hpp" /* Example of the 'Telemetry' library, a portable communication library for embedded devices. @@ -15,8 +15,6 @@ Repo : TO BE DONE */ -DigitalOut led(LED1); - struct TM_state { float direction; float throttle; @@ -42,6 +40,7 @@ // and pass the TM_state data structure to it. TM.sub(process, &carState); + DigitalOut led(LED1); led = 1; // Init the TheFreescaleCup shield @@ -63,12 +62,7 @@ for(;;) { - // update telemetry - if(tm_timer.read_ms() > 50) - { - tm_timer.reset(); - TM.update(); - } + TM.update(); // update servo control if(servo_timer.read_ms() > 10) @@ -85,7 +79,7 @@ } // publish car state & blink a led - if(print_timer.read_ms() > 500) + if(print_timer.read_ms() > 200) { print_timer.reset(); // Publish the car parameters, so we can access them from the computer