Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
BeagleBone Robotic Projects

You're reading from   BeagleBone Robotic Projects Developer or hobbyist, you'll love the way this book helps you turn the BeagleBone Black into a working robot. From listening and speaking to seeing and moving, we'll show you how ‚Äì step by step.

Arrow left icon
Product type Paperback
Published in Dec 2013
Publisher Packt
ISBN-13 9781783559329
Length 244 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Richard Grimmett Richard Grimmett
Author Profile Icon Richard Grimmett
Richard Grimmett
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

BeagleBone Robotic Projects
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started with the BeagleBone Black FREE CHAPTER 2. Programming the BeagleBone Black 3. Providing Speech Input and Output 4. Allowing the BeagleBone Black to See 5. Making the Unit Mobile – Controlling Wheeled Movement 6. Making the Unit Very Mobile – Controlling Legged Movement 7. Avoiding Obstacles Using Sensors 8. Going Truly Mobile – Remote Control of Your Robot 9. Using a GPS Receiver to Locate Your Robot 10. System Dynamics 11. By Land, Sea, and Air Index

Using the keyboard to control your project


Now the keyboard is connected, let's figure out how to accept commands on the BeagleBone Black.

Prepare for lift off

You can now enter commands wirelessly. The next step is to create a program that can take these commands and then have your project execute them. There are a couple of choices here and I'll give you examples of both. The first is simply to include the command interface in your program. Let's take the example of the program you wrote to move your wheeled robot, robot.py. If you like you can copy that program using cp robot.py remote.py. The following screenshot shows a listing of the current program in the area you want to change:

Engage thrusters

In order to add user control, you need two new programming constructs: the while loop and the if statement. Let's add them to the program, and then I'll explain what they do. The following screenshot shows a listing of the area of the code you are going to change:

You will edit your program by...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image