Raspberry Pi and Python

By: Vincent Fraser and Jerry Hernandez


An actual Raspberry Pi circuit board.

Although the Raspberry Pi may seem like some sort of snack, it is not recommended for consumption.  That is, unless you enjoy the flavor of printed circuit boards, copper wires, and central processing units.  

In actuality, the Raspberry Pi is a mini computer at the estimated size of a credit card, which is meant to run a small Linux distribution on one Gigabyte of Ram, along with a small quad core Arm CPU.

The device has multiple input/output pins (and ports) that are capable of being programmed.  Indeed, the Raspberry Pi is, in its entirety, a device that was meant to be programmed. Because of this, the Raspberry Pi can be used in unlimited projects, which may range from small game emulators, to robotics, or just a very small computer.  Almost anything can be done with the Raspberry Pi because of the way it was designed.  However, the Pi is not exactly meant to run Microsoft Windows as the main operating system.  After all, who would want to take the time to buy the Microsoft product, then attempt to load it onto the device, when they could just download and use open source Linux for free?  

Linux runs the best on the Raspberry Pi, and it uses the simple programming language Python to take advantage of the pins and ports on the main board.  With Linux’s Python programming language in the Raspberry Pi, along with the large user community, there are a sufficient number of tutorials and different modules that assist in adding additional content to the Pi.  Modules that have been made for the Raspberry Pi includes night vision cameras, many different types of sensors, touchscreens, and radio modules.  To top it off, if the module has not been made for the Raspberry Pi, one can be assembled from various broken electronics, attached to the circuit board, and programmed to allow the circuit to work again.  

The operating systems for the device ranges from small Linux servers, Ubuntu, Raspbian, Pidora, Android, and emulators for small game consoles.  All of these operating systems are meant to be loaded onto a small SD card, which will act as the Raspberry Pi’s storage space.  These SD cards can easily be swapped out, allowing for a quick operating system change from the SD card slot.  This simple addition is very useful to the Raspberry Pi because the data can be swapped whenever the user pleases.

No, not this python!

No, not this python!

One example of a project using the Raspberry Pi would be automation.  Many different home automation programs have been written in the Raspberry Pi in Python.  Some examples of devices that have been automated with the Raspberry Pi involves coffee machines, lights, and fish tanks.  Most of these automation systems are controlled through a main device, which is remotely connected to the Raspberry Pi controller in order to maintain an interactive system, to which timers and other settings may be applied.  In addition, robotics have been used with the Raspberry Pi, due to the simplicity of being able to control motors using Python through the Raspberry Pi pins, which are located on the circuit board.  When the Python code is implemented on the device, the Raspberry Pi will run the code and follow whatever instructions the code commands it to do.  For example, if the letter “W” is pushed on a keyboard from a remote location, the Python script will recognize that the key “W” has been pushed, which will cause a chain reaction of events to move the robot forward with motors.  For the most part, when at least one key of the code is successfully written, the copy and paste utility will be able to provide some minor tweaks to settings and motors, ultimately resulting in the robot gaining efficiency and saving time within the programming process.

Many different projects can be created using the Raspberry Pi, but most importantly, the Python programming language


Python logo.

is used to control it all.  So, what is Python, and how new is it?  Well, Python is not a new programming language.  It was created on February 20, 1991 by a man named Guido van Rossum.  What makes Python different than any other language is that Python is high in readability, mainly because there is a loosely-based syntax that relies on white spaces to make the program easier to read.  Syntax involves adding semicolons to the end of lines of code to tell the computer where the end of a line is.  Other various symbols, such as |, }, {, [, ],  ;  , and ,  are required to be placed within the line of code for proper functioning.  Due to Python’s various mathematical functions, the programming language is used for scientific scripting in order to solve math problems.  What makes Python a very unique programming language is that the program will run (as it is being written) in order to save time during programming, and even less time debugging.

Although the Raspberry Pi is a small circuit board, it has massive capabilities due to Python and the growing user community.  If you are interested in purchasing a Raspberry Pi the company website can be found at https://www.raspberrypi.org/. while the Python programming language can be found at https://www.python.org/.

Be the first to comment on "Raspberry Pi and Python"

Leave a comment

Your email address will not be published.