-
Notifications
You must be signed in to change notification settings - Fork 1
Home
This repository provides python software and information for a remote controlled robot car consisting of a 2-motors-3-wheels-chassis, raspberry pi 3, motor control L293D, bluetooth xbox controller as remote control and an ultrasonic distance sensor.
- Raspberry Pi Modell 3B with memory card powered by a power bank
- Robot Car Chassis Kit with 3 wheels (e.g. amazon)
- Motor controller IC L293D (e.g. amazon)
- Ultra sonic distance sensor modul HC-SR04 (e.g. amazon)
- xbox game controller bluetooth (e.g. amazon)
- IC sockets, resistor 1 and 2 kOhm, female connector strip and cable
- python3.6
- python evdev module
- python RPi.GPIO module
- python asyncio module
- xpadneo driver for the xbox controller
The project is tested on a raspberry pi 3B, Kernel 4.14.98-v7+, System Raspbian GNU/Linux 9 (stretch) and python3.6.
First Python3.6 must be installed (necessary for asyncio). The instruction github.com/dschep worked very well for me.
Next the xpadneo driver must be installed (necessary for rumble support of the xbox controller). Follow the instructions given in github.com/atar-axis/xpadneo and cross your fingers :-)
To install the necessary python modules, please use pip3.6.
Install evdev with sudo pip3.6 install evdev
.
Install RPi.GPIO with sudo pip3.6 install RPi.GPIO
.
To control a dc-motor with the IC L293D and Software-PWM is very well explained in
www.knight-of-pi.org/simple-dc-motor-board-for-the-raspberry-pi-with-ic-l293-and-software-pulse-width-modulation. This motor control is implemented in class Motor:
. The class motor_control:
allows then to comfortably set the speed and direction of the car using the speed and direction parameter with range [-1, 1] for backward/forward and left/right movement.
Calling the module directly with
sudo python3.6 motor_control.py
will start a short test which shows the use of the module.