User manual
26
Fig. 2.6: LED with button on a Raspberry Pi.
2.3 GPIO and Python
In order to be able to use Python programs on the GPIO ports, the Python library for GPIO must be installed.
If you are you not sure whether all necessary modules are installed, reinstall the up-to-date versions using
the following the console commands:
sudo apt-get update
sudo apt-get install python-dev
sudo apt-get install python-rpi.gpio
GPIO ports are listed as data files in the directory structure, as is common practice for all devices under a
Linux operating system. To access the file you will need root-level access privileges. Start the Python shell
with root privileges using the LXTerminal:
sudo idle