Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learn Robotics Programming

You're reading from  Learn Robotics Programming

Product type Book
Published in Nov 2018
Publisher Packt
ISBN-13 9781789340747
Pages 472 pages
Edition 1st Edition
Languages
Concepts
Author (1):
Danny Staple Danny Staple
Profile icon Danny Staple
Toc

Table of Contents (21) Chapters close

Preface 1. Introduction to Robotics 2. Exploring Robot Building Blocks - Code and Electronics 3. Introducing the Raspberry Pi - Starting with Raspbian 4. Preparing a Raspberry Pi for a Robot - Headless by Default 5. Backing Up the Code with Git and SD Card Copies 6. Building Robot Basics - Wheels, Power, and Wiring 7. Drive and Turn - Moving Motors with Python 8. Programming Line-Following Sensors Using Python 9. Programming RGB Strips in Python 10. Using Python to Control Servo Motors 11. Programming Distance Sensors with Python 12. Programming Encoders with Python 13. Robot Vision - Using a Pi Camera and OpenCV 14. Voice Communication with a Robot Using Mycroft 15. Programming a Gamepad on Raspberry Pi with Python 16. Taking Your Robot Programming Skills Further 17. Planning Your Next Robot Project - Putting It All Together 18. Assessments 19. Other Books You May Enjoy Appendix

Connecting the motors to the Raspberry Pi

In this section, we are trying to connect the motor to the Raspberry Pi. The following is the block diagram that we are aiming for as our output:

Block diagram of the robot

The first step in connecting the motors is to fit the motor hat onto the Raspberry Pi. The motor hat should look like the following:

The full function stepper motor hat

In this section, we will attach this hat to our robot, and wire it in so we can start programming our robot. The following photo shows how:

Fitting the motor controller

Perform the following steps :

  1. You will need the controller board (remove the foam strip if it has one), insulation tape, and a small screwdriver.
  2. The Raspberry Pi 3B+, mounted on the robot chassis, has four pins (indicated by the red arrow in the preceding photo). Other Pi models do not have this. This will need to be insulated from...
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 AU $19.99/month. Cancel anytime