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
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Intel Galileo Essentials

You're reading from   Intel Galileo Essentials Leverage the power of Intel Galileo to construct amazingly simple, yet impressive projects

Arrow left icon
Product type Paperback
Published in Feb 2015
Publisher
ISBN-13 9781784398903
Length 162 pages
Edition 1st Edition
Tools
Arrow right icon
Toc

Table of Contents (10) Chapters Close

Preface 1. Getting Started with the Galileo FREE CHAPTER 2. Accessing the GPIO Pins 3. Adding Display Functionality 4. Controlling DC Motors 5. Adding Sensors 6. Remote Control 7. Going Further with Galileo 8. Speech Output Index

Creating a program in Linux so that you can control your quadruped


You now know that you can talk to your servo motor controller, and move your servos. In this section, you'll create a python program that will let you talk to your servos to move them to specific angles. You'll use python as it is very simple and easy to run.

Let's start with a simple program that will make your legged mobile robot's servos go to 90 degrees (this should be somewhere close to the middle of the 0 to 180 degrees you can set.) If you are unfamiliar with the editing code in Linux, the best source is a tutorial on the editor you are using. For nano try http://www.howtogeek.com/howto/42980/the-beginners-guide-to-nano-the-linux-command-line-text-editor/. Here is the code:

Here is an explanation of the code:

  1. #!/usr/bin/python:- This first line allows you to make this python file execute from the command line.

  2. import serial:– This line imports the serial library. You need the serial library to talk to your unit via USB...

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