Book Image

Mastering Beaglebone Robotics

By : Richard Grimmett
Book Image

Mastering Beaglebone Robotics

By: Richard Grimmett

Overview of this book

Table of Contents (18 chapters)
Mastering BeagleBone Robotics
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Controlling your mobile platform programmatically using the BeagleBone Black and Python


Now that you have your motor running, your next step is to programmatically control the motor controller using the BeagleBone Black. If you are going to do this remotely, log in through PuTTY. If you are doing this directly on a monitor, simply log in.

I suggest you use Python in your initial attempts to control the motor. It is very straightforward to write, run, and debug your code in Python. I am going to include the directions here for Python; you can also go to the Pololu.com website at www.pololu.com/ and find instructions for how to access the capabilities in the C programming language.

The first Python program you are going to create is shown here:

To create this program, create a directory called track in your home directory by typing mkdir track, and then type cd track. You should now be in the track directory. Now open the file by typing emacs dcmotor.py. If you are using the nano editor, open...