Page 79 - Raspberry Pi as a Foundation for Boosting Computer and Technology Literacy
P. 79
Overview of programming languages6 6.3
The scope of hardware applications (i.e. physical computing) with
Python is even greater than that of software. This is primarily due to
the expandability of Raspberry Pi devices through the integration of
supplementary electronic components. To harness these extensive ca-
pabilities, Raspberry Pi OS comes equipped with an additional Python
library, gpiozero (Nuttall 2021). The library gives users the ability to
control the GPIO pins and, consequently, the hardware using abstract
modules and methods. Additionally, the potential can be further ex-
panded by combining gpiozero with other built-in Python modules
(e.g. time, random, os etc.).
C and C++
When compared to Python, both C (Kernighan and Ritchie 1988) and
C++ (Stroustrup 2013) are referred to as low-level programming lan-
guages and considered to have higher runtime efficiency. As a result,
both of these languages require a compiler for software development.
It is noteworthy that the Linux kernel itself is written in C and C++
(Jones 2007), and as a consequence GNU Compiler Collection is pre-in-
stalled on the majority of Linux systems, including the Raspberry Pi
OS. For editing and executing the code, practitioners suggest using
Nano (Ibrahim 2021, 34–35) along with the terminal or configuring
Geany by specifying the appropriate compiler options (Tavasalkar
2019, 57–59; Ibrahim 2021, 110–112).
Creating programs in C and C++ on a Raspberry Pi does not require
any additional prerequisites unless the user intends to interface with
GPIO pins. In that case, one of two commonly used libraries could be
utilized: pigpio (Pigpio, n.d.) or wiringPi (Henderson 2019a). While
wiringPi remains an older and more popular option that can still be
installed (Ibrahim 2021, 107–108) (albeit not through Apt), it is worth
noting that this library no longer receives support from its developer
(Henderson 2019b). In contrast, pigpio is currently supported, comes
pre-installed on Raspberry Pi OS, and offers similar features to the
deprecated wiringPi.
Perl
The Perl (Wall, Christiansen, and Orwant 2000) programming lan-
guage is considerably less popular than Python, C, and C++ for gener-
al software development. Alas, it is certainly less popular among the
users of the Raspberry Pi OS and is not frequently chosen as a tool
79