Book Image

BeagleBone By Example

By : Pei JIA, Jayakarthigeyan Prabakar, Alexander Hiam
Book Image

BeagleBone By Example

By: Pei JIA, Jayakarthigeyan Prabakar, Alexander Hiam

Overview of this book

BeagleBone is a low cost, community-supported development platform to develop a variety of electronic projects. This book will introduce you to BeagleBone and get you building fun, cool, and innovative projects with it. Start with the specifications of BeagleBone Black and its operating systems, then get to grips with the GPIOs available in BeagleBone Black. Work through four types of exciting projects: building real-time physical computing systems, home automation, image processing for a security system, and building your own tele-controlled robot and learn the fundamentals of a variety of projects in a single book. By the end of this book, you will be able to write code for BeagleBone in order to operate hardware and impart decision-making capabilities with the help of efficient coding in Python.
Table of Contents (17 chapters)
BeagleBone By Example
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Using Python to access GPIOs


In this section, we will see how we can change the state of a GPIO on the BeagleBone board from python's interactive shell interface with the help of functions available in the Adafruit_BBIO Library.

You will have to connect an LED with one of the GPIO pins on the BeagleBone Black to understand how these GPIOs work. The following steps will walk you through the program that you can execute step by step on the Python's interactive shell interface to understand how you can change the state of a GPIO from LOW to HIGH and vice versa from python:

  1. Connect an LED circuit to the BeagleBone board.

    To get started, we will need our Breadboard, LED, resistor, and hookup wires to connect the LED circuit with a GPIO available on the BeagleBone Black. Once you have them, connect the circuit as shown in the following figure:

    You can see that the cathode of the LED is connected to the Gnd pin on the BeagleBone Black through a 470-ohm resistor and the anode is connected to the GPIO...