Gestion du port GPIO du Raspberry Pi avec Python
Thereafter, we'll go on the assumption that we are developing on the latest model namely a Raspberry Pi B2. There are many libraries dedicated to the Raspberry Pi. They are stored, for the most part, on Pypi. We will study here is the historical library: RPi.GPIO. To install it, so just a simple install PIP: If you do not yet have pip, you just load get - pip.py, and then run it through the following command. wget python get-pip.py Of course, don't forget to use a 'sudo' if necessary. Reminder: Python is case sensitive. The GPIO port is accessible in root mode. sudo python mon_script.py Regarding the status of the input-output (I/O), the RPi.GPIO module accepts dedicated variables, integers or booleans. So, the high State may be worth to choose GPIO. III-B-1. The Raspberry Pi allows two sets of numbers: the silkscreen of the connector on the Board (GPIO.) Black numbering GPIO. GPIO.setmode(GPIO.BOARD) GPIO.setmode(GPIO.BCM) configuration = GPIO.getmode() III-B-2. III-B-3. III-B-4. III-B-5.
Related: RaspBerry Pi
• Smart video car WIKI