Teaching kids to code with Raspberry Pi
Tags: education, raspberrypi, python
Published: 2020-06-22 13:46:29

#Who am I?

I spent 3 years teaching computer programming at MC<sup>2</sup> STEM High School in Cleveland, Ohio before (attempting) a career change to full time developer. I intend on making a few more posts on teaching code to kids.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/oedkubrz6agb908pftbl.jpg)

#Raspberry Pi

My favorite piece of hardware for teaching coding is the Raspberry Pi. I had used them for about a year before attending PiCademy in 2017 where I really learned how to tap into their full potential. The Raspberry Pi is amazingly versatile. This versatility along with its very affordable price tag makes it the ideal tool for educational projects. The Pi also comes packed with great educational software like Scratch and Sonic Pi.

[![Antonio and Khyree show off their traffic light](https://i.imgur.com/sJ7M9ZC.jpg)](https://www.youtube.com/watch?v=u0HXTYAytIU
 "Antonio and Khyree show off their traffic light")

In my class we used the GPIO pins to control LEDs, attached motor controlling HATs (Hardware Attached on Top) to make robots that drove through custom obstacle courses, and the camera module to make selfie boxes. 

![Selfies](https://dev-to-uploads.s3.amazonaws.com/i/1mf7ycae6815hgag78xd.jpg)

The computers in my lab looked like standalone Raspberry Pis, but in fact they were networked together using PiNet, LTSP software specifically designed for Raspberry Pi. My entire 25 seat set up cost less than $2000 as I built the server myself (there's a funny story about bureaucracy here but that's for another time), the cost of just the Pis was less than $1000, and and I was able to keep the cost REALLY low after I found a closet full of the monitors, keyboards, and mice that I needed.

![My PiNet](https://dev-to-uploads.s3.amazonaws.com/i/056omi8585agf4nswih2.jpg)

PiNet was a game changer for me because I could remotely log in/out, lock, and take over student machines. It also made sure that students had their own accounts where they didn't need to have to worry about another student deleting their files.

You know that scene in "Ferris Bueller's Day Off" when the teacher monotonously says the same thing over and over again? This is not really so far from the truth of what it is to be a teacher. You can't imagine how exhausting it is to repeat the lesson website 4 times until everyone's in the right place: "I SAID it was eich tee tee pee colon slash slash... no, that's two slashes... double-u double-u double-u... OK, everyone, let's start over one more time...". So I wrote a python script  that did it for me. This turned out to be one of the unexpectedly fun aspects of the setup. I even used it to troll my students when they weren't on task. For these students I wrote a program for Minecraft that would drop lava blocks wherever their avatar would walk. Later on I would teach these tricks to students so that they could learn programming through their Minecraft games. 

[![Watch me troll students](https://i.imgur.com/h80jTJo.png)](https://www.youtube.com/watch?v=dBfHC2FOvNU "trolling students")

If I had had the funds I would have loved a classroom full of [PiTop](https://www.pi-top.com/) devices, which use Raspberry Pis as the brains to a wide assortment of educational products. 

I'm no longer teaching. I'm now trying to get my career started as a web developer, but I still look back, proud of my former students and the things they learned. Just last week I spoke with one of my former students, currently a sophomore in college, to give him career/life guidance. He's majoring in Computer Science.

![amar](https://dev-to-uploads.s3.amazonaws.com/i/pp87c145a9i6i9lgamlk.gif)