Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learning Beaglebone Python Programming
  • Table Of Contents Toc
  • Feedback & Rating feedback
Learning Beaglebone Python Programming

Learning Beaglebone Python Programming

By : Alexander C Hiam
close
close
Learning Beaglebone Python Programming

Learning Beaglebone Python Programming

By: Alexander C Hiam

Overview of this book

If you have experience with the Python language and are interested in getting started with electronics, then BeagleBone Black is the perfect platform for you and this book will provide you with the information you need.
Table of Contents (14 chapters)
close
close

Interactive GPIO

Let's take a look at how the GPIO pins can be controlled from Python's interactive interpreter. Enter the Python interpreter by running the python command without any arguments into a terminal (either in Cloud9 or in an SSH session), as shown in the following command:

root@beaglebone:/var/lib/cloud9# python
Python 2.7.3 (default, Mar 14 2014, 17:55:54)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

Next, import everything from the PyBBIO library:

>>> from bbio import *

Now let's light one of the BeagleBone's on-board LEDs. Use the digitalWrite() function to set the GPIO output attached to the USR3 LED to its high level:

>>> digitalWrite(USR3, HIGH)

Take a look at USER LEDS closest to the Ethernet connector on your BeagleBone, it should now be lit up, as shown in the following screenshot:

Interactive GPIO

Go ahead and turn it off by setting it to a low state...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Learning Beaglebone Python Programming
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon