Chapter 9

Introducing Python

In This Chapter

arrow Getting acquainted with Python

arrow Writing your first Python script to blink an LED

arrow Using Python to configure an input pin and test your code with a pushbutton

One of the greatest features of the BeagleBone is the fact that you can program it in several programming languages. After all, the BeagleBone is an embedded Linux system that works just like a computer, with the added perks of input and output pins.

This chapter introduces Python, a powerful programming language that features a dedicated library to interface with the BeagleBone. Python code is easy to understand, and Adafruit’s BeagleBone IO (input/output) Python Library that you use in this chapter offers a plethora of functions that enable you to control the BeagleBone’s pins in a simple and intuitive way.

technicalstuff.eps This library has conventions that are very similar to the Python library dedicated to Raspberry Pi, the popular RPi.GPIO. Thus, porting projects from one platform to the other should be quite straightforward.

Throughout this chapter, we greatly advise that you use the Cloud9 ...

Get BeagleBone For Dummies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.