WEEK 9 / Output devices
This week we learned about output devices.
Weekly assignments
Group assignment
Measure the power consumption of an output device.
You can find the group assignment in our group page.
Individual assignment
I'm behind schedule, since I'm still not done with the development board from Week 8. I didn't want to let that be a limiting factor for learning about this week's content, so decided to use the Barduino board from the BCN Fab Lab to control this set of neopixels. I'll later update the page when I have my owndevelopment board working.
I had already set up Thonny to work with MicroPython. However, important to check the port and the interpreter for your microcontroller. Also make sure the esptools is installed.
To work with the neopixels, I generated a blink test code with the help of ChatGPT.
The first portion of the code imports the required libraries. "machine" interacts with the pins from ESP32, "neopixel" is the library to control neopixels, and "time" is for the sleep function. Then, assign the amount of neopixels involved and and name the pin we are connecting on our board.
In order to have more control over the neopixels, I wanted to name them. I decided to set each one of them to a different color, to understand how they are organized in the component. Also asked ChatGPT for this code. So in this case, the first one is the center one, then it goes around clockwise.
I have this idea of making a moon calendar. Now, knowing how the neopixels are set, this is how we should light up the neopixels at a time:
Update: making it work with my own development board (which was designed and made in the electronics design assignment). (ignore the perforated board and the blue wires, I was also working on another project at the time).
FILES: