Robotics Class Meets Christmas Trees

November 22, 2021 / Andrea Wenger

Mackenzie Miller ’23 is a Robotics I student and shared this report of her Christmas tree project.

We have been working with the Arduino Uno, most recently learning how to code multitasking.

I was given most of the materials including the tree, LEDs, and the disco ball ornaments. To cover all the wiring, I used a box I found in my closet that was the exact size I was looking for. The fabric, spinning ornaments (and snowflake ornament), and the fabric was sourced from gift and thrift.

The most challenging aspect was coding the speaker to play at the same time as everything else. I tried a few different ways, but with some help eventually got the speaker to work and coded the melody of Christmas Tree Farm by Taylor Swift using pitches.

The code uses class Flasher, class Blink, and class Sweeper to separate the tasks so they can all run simultaneously. I incorporated the song code to void loop. It doesn’t have its own class but still runs at the same time. See a YouTube video. See image at right of the code.

Check out some more photos from this story

Posted in tagged: , ,

Leave a Comment