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
Revision 2:74d5233b6284, committed 2016-03-09
- Comitter:
- Overdrivr
- Date:
- Wed Mar 09 15:45:28 2016 +0000
- Parent:
- 1:5a07069e17b6
- Commit message:
- headers include update
Changed in this revision
diff -r 5a07069e17b6 -r 74d5233b6284 FRDM-TFC-HBRIDGE.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FRDM-TFC-HBRIDGE.lib Wed Mar 09 15:45:28 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/emh203/code/FRDM-TFC/#24430a0d7fd8
diff -r 5a07069e17b6 -r 74d5233b6284 FRDM-TFC.lib --- a/FRDM-TFC.lib Mon Feb 22 21:24:52 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -http://mbed.org/users/emh203/code/FRDM-TFC/#24430a0d7fd8
diff -r 5a07069e17b6 -r 74d5233b6284 main.cpp --- 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
diff -r 5a07069e17b6 -r 74d5233b6284 telemetry.lib --- a/telemetry.lib Mon Feb 22 21:24:52 2016 +0000 +++ b/telemetry.lib Wed Mar 09 15:45:28 2016 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/Overdrivr/code/telemetry/#8e3de1a314e1 +http://mbed.org/users/Overdrivr/code/telemetry/#f5e1b079bffd