One of the great advantages of working with Python as our programming language to interact with the board is that we have plenty of packages available for Python. We have been using the
mraa library to interact with the digital outputs. However, in the previous chapter, we also installed the
wiring-x86 library. We can change just a few lines of our object-oriented code to replace the
mraa library with the
wiring-x86 one to turn on and off the LEDs.
The following lines shows the code for a
Board class followed by the new version of the
Led class that works with the
wiring-x86 library instead of using
mraa. The code file for the sample is
from wiringx86 import GPIOGalileoGen2 ...