Coding the Raspberry Pi 3B+ model began with a rocky start. I realized the steepest portion of the mountain arrived, just as AP Exams were around the corner, creating one of the most stressful weeks of my academic career. Knowing that ChatGPT-provided code did not perform sufficiently through various tests and presentations at the Showcase, I knew the necessity of finally learning how to work with code on my own. With a stressful road ahead of me, I scrambled to decipher the initial step of uploading the Raspberry Pi OS Desktop onto my module. It turned out to be quite simple after a few hours of research and anxiety-ridden breakdowns, since it only required a USB drive (an extra of which I had at home) and an adapter (that I borrowed from the SHC Library) to install the set-up software via Raspberry Pi Imager. Once I plugged the drive into my Raspberry Pi, I was finally ready to code.
Through hours of filtering through conversations on Stack Overflow and code functionality on Github, related to python speech recognition, I ended up with an overwhelming amount of bookmarked tabs on my browser I figured could be useful for later. To officially begin, I came up with a to-do list: First, I aimed to code the OLED to display text, without the transcription portion, to confirm the quality performance of the display module. Further steps would be to research various existing speech recognition softwares to combine with the OLED display code. The final step would include running the code on startup and headless, or detached from a monitor, keyboard, and mouse.
It was still May when I began coding the OLED. I looked into existing software, specifically the Adafruit Circuit Python package on Github. One of the initial challenges I faced as a rookie in Python and Raspberry Pi coding was the “externally managed environment” error I received an annoying number of times from the terminal, each time I tried to install a new package. After some research, I discovered that it was an issue of forgetting to first create a virtual environment to install the foreign packages in. Inside “myvirtualenv,” I could install as many packages as I could via the terminal. So, I explored the Adafruit Circuit Python package, running existing code examples on my Raspberry Pi, displaying my first 3 pixels on the OLED, creating a picture similar to the constellation, Orion’s Belt, in the night sky- truly an inspirational milestone that encouraged me to continue forward.
However, after digging through the various examples provided, including a digital clock that could display the time on the OLED, along with moving hands on the analog clock. I figured I wanted something simpler, since none of the examples I filtered through included explicit code for displaying text on the module. I found the “oled-text” package online, along with a website explaining its functionality through examples and a simple, one-command-line installation. I could now display text on any of the 4 lines on the 128×64 OLED, starting with every programmer’s first words: “Hello World!”