We used JavaScript language to program BeagleBone untill now. Now we'll focus on another popular language for programming BeagleBone—Python. It is a general purpose, widely adopted, high level language. It is easy to do coding in Python. Similar to BoneScript, there is a Python library from Adafruit that can do GPIO/Analog IO for BeagleBone. There is also an alternative library available called PyBBIO
, which strongly follows the Arduino style of coding. As Adafruit's library is very similar to the BoneScript we learned earlier, we will follow it to code in Python throughout the book.
In this chapter, we will do many physical computing exercises in Python that we did in earlier chapters using JavaScript
/node.js
. It is assumed that you have gone through the earlier chapters. A good knowledge of the theory from Chapter 2, Blinking Onboard LEDs up to Chapter 6, PWM – Writing Analog Information is essential to get the most out of this chapter.
This chapter...