To prepare for my Blue Sky Project I need to learn about programming the Raspberry Pi.
What is Raspberry Pi you ask? Sadly it’s not food – but instead is a pretty cool pocket sized computer.
It runs the Linux software – so the first thing I had to learn was how to talk to Linux. That involves interesting commands like “cd” to change directory (also known as entering a folder) and “ls” to list the files in the folder.
Once I figured out how to get around in Linux the next step was to learn some programming using Python. This means learning some of the standard programming terms such as “IF”, “ELSE”, “WHILE”, “IMPORT” etc. These are keywords that tells the program what you want it to do.
My plan is to use sensors with the Raspberry Pi and its General Purpose Input/Output (GPIO) pins. As a first step I am leaning to control LEDs that are set up on a breadboard. This is not somewhere you slice bread – but instead is a plank of plastic with lots of tiny pin holes. The LEDs are placed in these holes and then I can control the current that is sent to them from my python program.
This has involved learning some basic electronics – but luckily my Dad has a degree in Electrical Engineering – so I’ve been learning from him.
So far I have written programs that can:
- Turn on an LED
- Turn off an LED
- Make the LEDs blink
- Push a button on the breadboard to make them blink
In addition I have learnt a bit about Ohm’s Law (Electronics Club – Ohm’s Law), how to read resistor values (Orca DX and Contest Club — Tips and Tools — Resistor Color Codes), how to use the GPIOZero library (gpiozero — Gpiozero 1.2.0 documentation), and how to read an electronic component data sheet (e.g. RGB LED Data Sheet).
The next steps will be to test out the different types of sensors that could be used in my final project.
This is a short video showing my LEDs being controlled by a push button.
This blog post was written on a Raspberry Pi computer.
May 4, 2016 at 8:15 am
Ryan this looks great! Think about linking to your other post explaining your Blue Sky Design Project to help people get a context for the work you are doing.