Learn Robotics with Raspberry Pi by Matt Timmons-Brown
Author:Matt Timmons-Brown
Language: eng
Format: epub, azw
Publisher: No Starch Press
Published: 2019-01-22T16:00:00+00:00
FIGURE 4-7 Two different PWM voltage traces: a duty cycle of 25 percent (top) and a duty cycle of 50 percent (bottom)
While PWM is not a perfect approximation of an analog signal, for most cases it works well, especially at this level. Digitally encoding analog signal levels will allow you to control the exact speed of your robot’s movement.
The GPIO Zero Python library authors have made it easy to vary motor speed using PWM, so you don’t need to know the exact mechanics behind it. All you need to do is provide a value between 0 and 1 in the parentheses of each motor command to represent a value between 0 percent and 100 percent, as follows:
robot.forward(0.25)
time.sleep(1)
robot.left(0.5)
time.sleep(1)
robot.backward()
time.sleep(1)
NOTE
If your robot has been zipping around too fast in the previous examples, feel free to go back and adjust the speed in the last two projects using this method!
Download
Learn Robotics with Raspberry Pi by Matt Timmons-Brown.azw
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Automotive | Engineering |
Transportation |
Whiskies Galore by Ian Buxton(41506)
Introduction to Aircraft Design (Cambridge Aerospace Series) by John P. Fielding(32874)
Small Unmanned Fixed-wing Aircraft Design by Andrew J. Keane Andras Sobester James P. Scanlan & András Sóbester & James P. Scanlan(32554)
Craft Beer for the Homebrewer by Michael Agnew(17916)
Turbulence by E. J. Noyes(7679)
The Complete Stick Figure Physics Tutorials by Allen Sarah(7114)
Kaplan MCAT General Chemistry Review by Kaplan(6562)
The Thirst by Nesbo Jo(6420)
Bad Blood by John Carreyrou(6257)
Modelling of Convective Heat and Mass Transfer in Rotating Flows by Igor V. Shevchuk(6214)
Learning SQL by Alan Beaulieu(6009)
Weapons of Math Destruction by Cathy O'Neil(5802)
Man-made Catastrophes and Risk Information Concealment by Dmitry Chernov & Didier Sornette(5617)
Digital Minimalism by Cal Newport;(5349)
Life 3.0: Being Human in the Age of Artificial Intelligence by Tegmark Max(5164)
iGen by Jean M. Twenge(5139)
Secrets of Antigravity Propulsion: Tesla, UFOs, and Classified Aerospace Technology by Ph.D. Paul A. Laviolette(4889)
Design of Trajectory Optimization Approach for Space Maneuver Vehicle Skip Entry Problems by Runqi Chai & Al Savvaris & Antonios Tsourdos & Senchun Chai(4829)
Electronic Devices & Circuits by Jacob Millman & Christos C. Halkias(4724)
