Computer Bootcamp Day 1: Raspberry Pi

This weekend we are holding a two-day computer bootcamp for our kids, some friends of theirs and a handful of adults. Here is a recap of the first day both as a reminder and reference for those who participated and as an outline for anybody else who wants to try this.

We started by watching the first minute or so of a clip showing NASA mission control. I then explained that for the Apollo 11 program NASA had five mainframes from IBM (System 360 Model 75 with 0.034 MIPS and 1 MB of main memory each). We then found that the Raspberry Pis in front of us come with 512 MB of main memory and can perform at 100s of MIPS. Put differently we were holding in front of us a computer that was 100 times more powerful than the entire computing infrastructure for the moonshot!

We put the RPis in this great case (purchased as part of the great RPi starter kit from Adafruit) and connected one of them to keyboard, mouse, monitor and then power. Of course nothing happened. Why? Because we had no operating system installed. I got everyone to search for how to install an operating system for the RPi. We then proceeded by downloading Occidentalis 0.2 (based on Raspbian Wheezy, which in turn is a variant of Debian, which is a type of Linux). We used the Raspberry Pi SD Installer to flash the Occidentalis disk image onto a 4GB SD card. We did this from the command line using terminal in OS X and I explained that the name terminal came from the original dumb terminals.

Since we had a few minutes while the SD cards were being written we played a little game. Two students paired up and one had to get the other to draw a letter on the whiteboard by giving precise commands about line strokes. After that we discussed how programming or computational thinking is something that we all do to some degree every time we explain to someone else how to do something.

We now had working RPIs and booted each of them up connected to a monitor, keyboard and mouse. I walked everybody through how to configure the keyboard layout, timezone, etc. and soon enough we had them running and fired up the Scratch environment to play around a bit. We then proceeded to install a wifi card and had our first encounter with the GNU nano editor. We also learned about why we need to use sudo if we want to edit a file such as /etc/network/interfaces which holds the wifi configuration information.

We then learned how to use sudo ifconfig to display the IP address of our RPIs (and write them all down on a big white board). I then drew a diagram that showed how all of our addresses were local to the network we were on and not reachable directly from the internet. We used ping and traceroute from the command line to examine the network between our RPis and also computers on the internet. Since there were 10 students in the group in total each with their own RPi but only 5 monitor and keyboard setups it was now the perfect time to learn about ssh and how to use it to connect to a headless RPi. In fact we took several of the RPis and distributed them to different locations around the room to really demonstrate that we were remotely connecting into the machines. For the two students with Windows machines we used Putty.

Now it was time to do a little bit of programming. We again used nano to write a small program in Python that adds the numbers from 1 to 1000 (yes, there is a simple formula for that but the point was to illustrate how fast the machines could do this brute force). We then also wrote the same program in C and used gcc to compile it. We noted that our C program executed significantly faster than our Python one. I explained that what we read and write is the source code which needs to be translated into machine code which are the instructions executed by the computer.

To show that we can extend our RPis we then all put together a very simple breadboard containing an 8x8 three-color LED matrix. We downloaded the sample code for lighting up the LEDs using git. There were a lot of screams of excitement when the LEDs connected to a headless RPi started to flash.

The plan for tomorrow is to write a short program to fetch some value from the internet (eg the weather) and then make the LEDs light up accordingly. We will then also set up a website on our RPis and finally do the same using a cloud server.

Loading...
highlight
Collect this post to permanently own it.
Continuations logo
Subscribe to Continuations and never miss a post.
#raspberry pi#computer boot camp#learning