Reader small image

You're reading from  Raspberry Pi Robotic Projects - Third Edition

Product typeBook
Published inOct 2016
Reading LevelBeginner
Publisher
ISBN-139781786467966
Edition3rd Edition
Languages
Concepts
Right arrow
Authors (2):
Richard Grimmett
Richard Grimmett
author image
Richard Grimmett

Dr. Richard Grimmett has been fascinated by computers and electronics from his very first programming project, which used Fortran on punch cards. He has bachelor's and master's degrees in electrical engineering and a PhD in leadership studies. He also has 26 years of experience in the radar and telecommunications industries, and even has one of the original brick phones. He now teaches computer science and electrical engineering at Brigham Young University, Idaho, where his office is filled with his many robotics projects.
Read more about Richard Grimmett

Jon Witts
Jon Witts
author image
Jon Witts

Jon Witts has been working within the IT industry since 2002 and specifically within Educational IT since 2004. He was introduced to Linux back in 2001 through his collaboration with two German artists who were visiting the arts organisation he was then working with. Having studied Fine Arts and Educational Technology and sought to innovate with open and accessible digital technologies within his creative practice, Jon is happiest when deconstructing technology and finding its limits. Jon has embedded within his school the use of Raspberry Pi computers, as an integral part of the delivery of the school's Computer Science curriculum as well as to run various school clubs and projects. Jon is a Raspberry Pi Certified Educator and also helps to organise and run the Hull Raspberry Jam events. I would like to thank my wife, Sally and our three daughters for putting up with all the cables and compoents around the house, and not least for being so tolerant of the need to dodge the robots racing round the kitchen floor!
Read more about Jon Witts

View More author details
Right arrow

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:

  1. Type cd ~.

  2. Run the git clone https://github.com/simonmonk/raspirobotboard3.git—command this will retrieve the library.

  3. Then type cd raspirobotboard3/python to go to the raspirobotboard3/python directory.

  4. 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...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Raspberry Pi Robotic Projects - Third Edition
Published in: Oct 2016Publisher: ISBN-13: 9781786467966

Authors (2)

author image
Richard Grimmett

Dr. Richard Grimmett has been fascinated by computers and electronics from his very first programming project, which used Fortran on punch cards. He has bachelor's and master's degrees in electrical engineering and a PhD in leadership studies. He also has 26 years of experience in the radar and telecommunications industries, and even has one of the original brick phones. He now teaches computer science and electrical engineering at Brigham Young University, Idaho, where his office is filled with his many robotics projects.
Read more about Richard Grimmett

author image
Jon Witts

Jon Witts has been working within the IT industry since 2002 and specifically within Educational IT since 2004. He was introduced to Linux back in 2001 through his collaboration with two German artists who were visiting the arts organisation he was then working with. Having studied Fine Arts and Educational Technology and sought to innovate with open and accessible digital technologies within his creative practice, Jon is happiest when deconstructing technology and finding its limits. Jon has embedded within his school the use of Raspberry Pi computers, as an integral part of the delivery of the school's Computer Science curriculum as well as to run various school clubs and projects. Jon is a Raspberry Pi Certified Educator and also helps to organise and run the Hull Raspberry Jam events. I would like to thank my wife, Sally and our three daughters for putting up with all the cables and compoents around the house, and not least for being so tolerant of the need to dodge the robots racing round the kitchen floor!
Read more about Jon Witts