During the first few weeks of December I worked with undergraduate and graduate students at the University of Central Florida (UCF). I showcased Node.js, running on a Raspberry Pi, to interface with a Sphero 2.0. I wrote all the code on a Windows computer using Visual Studio 2015, then I transferred it through SSH to the Raspberry Pi running Raspbian. In the following sections I have broken down the code into seven different parts.
I added additional hardware parts to make the project entertaining for the students and more engaging overall. The project used the Sphero 2.0. The earlier versions, and Sphero’s BB-8, will connect differently than the methods I explain below. A game pad, iBuffalo’s Super Nintendo controller, was used to drive the Sphero. The official Raspberry Pi 7″ touchscreen display was used as a way to view the code running, and it was housed in the Smarticase enclosure. For audio, which is really fun to play with, I hooked up parts one and four from the AIY Project kit. This was the voice HAT accessory board which allowed audio output to the 3″ speaker.
I used the result of this project as piece to present during one of my graduate level courses. All of my code is available on GitHub. This guide will assume you have Node.js installed, and understand how to install packages.