Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Intel Galileo Essentials

You're reading from  Intel Galileo Essentials

Product type Book
Published in Feb 2015
Publisher
ISBN-13 9781784398903
Pages 162 pages
Edition 1st Edition
Languages

Table of Contents (15) Chapters

Intel Galileo Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started with the Galileo 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

Galileo code for DC motor direction control


Open the IDE and type in the following code:

This code sets up pins 3, 4, and 9 to enable the chip and control the direction of the motor. As mentioned before, you can use the Tools | Serial Port to send data to the program. Sending a 0 sets pin 3 to HIGH and pin 4 to LOW, causing the motor to spin in one direction. Sending a 1 sets pin 3 to LOW and pin 4 to HIGH, causing the motor to spin in the other direction.

Now you know how to build circuits to control both the speed and the direction of DC motors. However, instead of procuring all the parts and building the circuits yourself, you can actually buy a DC motor control shield.

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 $15.99/month. Cancel anytime}