This project aims at hacking a remote controlled car by replacing the tx/rx and navigation systems. This project implements the car side.
Dependencies: mbed-rtos mbed ssWi
This project consists of a remote controller which pilots a car holding a video camera onboard. It is divided in two main parts:
- user side: the microcontroller reads the user input from the joystick (four potentiometers), elaborates them and then sends those commands through the wireless connection (using a XBee module);
- car side: the microcontroller receives the sent commands (using a XBee module), elaborates them and adjusts the main engine, the steering servomotor and the two servos which move the X-Y axis of the onboard video camera.
Here are a image of the hardware and a video I recorderd and edited.
Concerning the part related to the user side, the project is the following.
Import programrover_pc
This project aims at hacking a remote controlled car by replacing the tx/rx and navigation systems. This project implements the pc side.
The communication protocol I exploited to make the two parts communicate each other is ssWi.
Import libraryssWi
A simple wireless protocol to let my examples communicate each other. ssWi stands for Shared Slotted Wireless protocol
carDrivers/car.cpp
- Committer:
- mariob
- Date:
- 2013-03-12
- Revision:
- 0:97d3a2b0ff58
File content as of revision 0:97d3a2b0ff58:
#include "car.hpp" Car::Car ( PinName pinCamX, PinName pinCamY, PinName pinSteering, PinName pinMotor): cameraX(pinCamX), cameraY(pinCamY), steering(pinSteering), motor(pinMotor) { angleX = 0; angleY = 0; cameraX = 0.0; cameraY = 0.0; steering = 0.0; motor = 0.0; } void Car::setSpeed (float s) { motor = s; } void Car::setSteering (float angle) { steering = -angle; } void Car::setCamera (float x, float y) { cameraX = x; cameraY = y; }