Week of 2/10 - 2/14
- kaurmanji0719
- Feb 13
- 2 min read
This week I focused on finishing the word clock code and getting it to a place where I could actually test it on the board of letters. Last week, my light strip that I was testing code on stopped working because a few of the LEDs at the beginning of the strip had broken. To fix this, I cut off the broken LEDs and soldered new wires to the next working LED on the strip. This worked and allowed me to continue working with the same light strip I was using before rather than having to get a whole new one.

After this, I worked on completing the code for the clock. The problem that I was attempting to solve was an issue with the minute words on the display. When the RTC read a minute value between 0-5, it failed to display the hour on the light strip. The only lights that would turn on were the ones I have set to always be on ("It is" and "o'clock"). In order to fix this, I had to take the code that controlled the hours out of the large for loop that controlled the minutes. Previously, I had one big for loop that was supposed to control both hours and minutes. My first thought to fix this code was to add an "else if" condition to my "if-else" statement for when the minute variable is equal to 0-5. This didn't work because it still did not control the hours separately from the minutes.

I then decided to take out all of the lines that controlled the hour and create a different for loop with it that was relative to the variable that controlled the minutes. This way, one for loop would not work to control two individual aspects of the display. This new for loop used the variable that accounted for the minutes to display the hour but did it so it was independent of the other minute control. This solved the problem and displayed the time accurately complete with "past" and "to" switches that had also been finnicky in the code previously.

We tested this final code on the word clock board and it worked. The time changed as it was supposed to with small delays in the changing of the display. The problem now is that the LEDs are organized differently on the board than they are in my code. Where the light strip I used is one singular line of LEDs, the Word Clock board's LEDs are connected at different places which changes the numbering of the LEDs. We found this problem after observing a few time changes and seeing that they displayed the complete wrong times because the incorrect LEDs were being lit up. I believe the way to fix this issue is by changing the range of LEDs controlled by the various elements in the arrays that I am using. The array relates the LED positions to the ones on the light strip right now rather than the ones on the board. I plan on fixing this problem next. Below is a picture of the clock displaying the correct time.





Comments