Controlling Wall-E's tracks using a Raspberry Pi in Python
The hardware is ready; now you can access this functionality from a Raspberry Pi. First, install the library associated with the control board, found at http://www.monkmakes.com/rrb3/. Perform the following steps:
Type
cd ~
.Run the
git clone https://github.com/simonmonk/raspirobotboard3.git
—command this will retrieve the library.Then type
cd raspirobotboard3/python
to go to theraspirobotboard3/python
directory.Type
sudo python setup.py install
—this will install the files.
Now you'll create some Python code that will allow you to access both the DC motors on your tracked platform. Here is some basic code that allows you to do this:
#!/usr/bin/python import time from rrb3 import * rr = RRB3(9, 6) rr.set_motors(1, 0, 1, 0) time.sleep(1) rr.set_motors(0, 0, 0, 0) rr.sw1_closed()
The lines of the code import the time...