Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Programming the BeagleBone

You're reading from  Programming the BeagleBone

Product type Book
Published in Jan 2016
Publisher
ISBN-13 9781784390013
Pages 180 pages
Edition 1st Edition
Languages

Table of Contents (21) Chapters

Programming the BeagleBone
Credits
About the Author
Acknowledgment
About the Reviewers
www.PacktPub.com
Preface
Cloud9 IDE Blinking Onboard LEDs Blinking External LEDs Controlling LED Using a Push Button Reading from Analog Sensors PWM – Writing Analog Information Internet of Things with BeagleBone Physical Computing in Python UART, I2C, and SPI Programming Internet of Things using Python GPIO Control in Bash BeagleBone Capes
Pinmux and the Device Tree Index

Reading from digital components


Push buttons are digital. They are either pressed or released. There are some touch buttons that work just like push buttons. They generate a HIGH signal when touched. There are some sensors that work as HIGH/LOW digital input devices. They just give information if the threshold value is reached or not. For example, some IR sensors come with a digital pin that gives only a HIGH/LOW value if it detects an obstacle in between a specific distance. Any electronic device capable of generating a HIGH/LOW signal can be treated as an input device. This signal is sensed at the connected BeagleBone pin and the input value is interpreted as HIGH/LOW. These are all digital input devices.

The BoneScript library provides the function digitalRead() to read from digital components. The function digitalRead() requires the pin to be initialized first using the function pinMode() similar to digitalWrite(). But it should be initialized for input unlike digitalWrite(). Here is...

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}