Week of 11/18 - 11/22
- kaurmanji0719
- Nov 21, 2024
- 2 min read
This week I started on the code for the Giant Word Clock. I started by playing around with a basic light strip and mapping out the letters on the word clock to corresponding LEDs on the strip. I created a chart that would help me keep the position of the words organized on the light strip. With my chart created, I was able to start building the code for the word clock. I started with a switch case code that would light up a segment of LEDs depending on the variable value that I would set manually. Since I haven't set up a clock to work with the LEDs yet, I'm just using variables that I can control easily before I try to add the clock into the code. Since the clock only displays the time by every five minutes, precise minutes such as 17, 23, and 58 can't be shown on the clock. Because the switch case code only accounted for specific cases and numbers, I decided that making 60 different cases was impractical. Mr. Christy suggested that I should utilize and array and some for loops to turn on the lights. Using the code seen below, I was able to convert these precise minutes into displaying the nearest fifth minute they corresponded to. The next problem I faced was that of displaying the minutes relative to the hour. The words "past" and "to" have to be used to express the time properly and so far, I haven't found a solution to that issue yet but I have been working on that. So far I have an if statement I've tried to use to fix this problem but I haven't figured it out quite yet.





Comments