For the Skillbuilder: Electronics project, we were tasked with selecting an electronic and learning how to use it. We then had to make a presentation and a reference guide to teach other members of our class. The goal was to orient ourselves to a new electronic and pass that knowledge onto others, and in the process, deepen our understanding of it.
The options for electronics: analog input, digital input, or output. I selected an output and specifically, a seven-segment display. In simple words, a seven-segment display is a group of LEDs that show a certain number when specific segments are turned on. After learning how it worked, I created a reference guide, shown to the left, and a program shown below. The reference guide details an overview of what a seven-segment display is, how it works, and some examples of how to use it. With my reference guide and program I coded, I taught a fellow classmate how to use the electronic by explaining how to wire it with a pico kit, set up basic code to turn on each LED, and make a complex code with it. First, I showed a diagram of the seven-segment display that details each segment to the student. While showing this, I explained how each segment is an LED with its own pin and circuit. Then, I asked the student what segments needed to be turned on to display the number 1. After, I went to MicroPython and ran the code that displays the number 1. Next, I presented the circuit diagram and gave them time to understand and ask questions after I explained the wiring. Then, I ran each of the 10 codes for every number 0-9. I then reminded them of when we learned how to generate random numbers in code. This tied into my next step, where I presented the code I created to display a random number on the seven-segment display. Finally, I asked the students if they had any questions and concluded my presentation.
I started by coding programs to display each individual number on the seven-segment display. I made code for the numbers 0-9 as I had a single-digit seven-segment display.
Code for the Number 0
Code to display the Number 1
Code for the Number 2
Code for the Number 3
Code for the Number 4
Code for the Number 5
Code for the Number 6
Code for the Number 7
Code for the Number 8
Code for the Number 9
After creating these, I combined them along with other skills, like generating random numbers, to create a new program shown below.
To understand this code, we can look at it through a pseudocode diagram linked here: https://drive.google.com/file/d/1Qpjp3XNqw9lPiQZ-NaLD-j_bXbvDFHsZ/view?usp=sharing (open with draw.io to see better)
When the code is run, it generates a random number. This random number is then displayed on the 7-segment display. Then, the code pauses for one second before repeating and displaying a new number.
To begin, I researched how to use a seven-segment display and took notes on an article. At first, the article was very confusing and frustrating. It included a very long code with elements like lists that I had not learned yet. I focused on using the diagrams within the article and the basic building blocks of the code to understand how to wire the circuit. Once the circuit was wired, I practiced turning on each segment using MicroPython. This step was simple, as it was similar to running code for an LED light. After learning how to display each number, I wrote ten separate codes for each number. This took a while but was simple. Then, using each code, I created a code to display a random number 0-9.