!DOCTYPE html> Michael Mara | Code 2 Portfolio

Experimental Clock

Description

For this project, we were to design and code an experimental clock that expresses a novel way of tracking time. We needed to include both an IF / ELSE Statement and millis(), OR second() / minute() / hour() in the clock.

Design Process

I decided to stick with a traditional circadian rhythm to avoid any confusion as I'm still learning to code. I was especially drawn to Morning Glory and Moonflowers as they bloom daily, one in the morning and latter at night. The purple flower represents the Morning Glory, they traditionally bloom at around 4:30 AM and shrink throughout the day. The white represents the Moonflower which blooms at night. In this sketch, 30 seconds represents 12 hours.

Reflection

I had quite a lot of trouble this week when it came to lining up the code to the appropriate time. Instead of having the Moonflower bloom at 30 seconds, it starts popping out of the center at 23 seconds. The other issue I had was getting the Moonflower to stop growing. In my code, I tried to apply a constraint but it didn't seem to work so the flower keeps growing until the clock resets so there is a bit of a jolt in size as the flower turns purple. I also wanted to figure out a way to have the polygon stop shrinking once it reached the center signaling that the day has ended and start the Moonflower signaling the start of the evening but instead there is a few seconds of the shape lost behind the center of the flower.