If you can't get to Paris in the springtime, how about bringing Paris into the home? Yes, you've guessed it. Another clock. This time modelled on the Eiffel Tower. Years ago Elektor designed one styled to look like the Rhine Tower, this is my take on that inspiration. It stands 50cm tall, with 60 through hole WS2812 addressable RGB LEDs along with 9 3mm red LEDs on the "balconies" and top of the tower. The colour of the LEDs is lost a little in the pictures and video. The reflection in the oven hob shows the colours more as they are seen with the eye. The software is identical to that of the WS2812 "ring" clock and can be found there. The recent re-write of that software to include the "overlap" and "part" modes were written in anticipation of these PCBs being delivered. For a linear clock I thought that having "hands" wasn't going to work. The picture and the YouTube video both show the clock operating in what I call "part" mode, where the lowest (and hence shortest) value of either hours or minutes is shown in full in the relevant colour for hours (green) or minutes (red) with the remainder of the display being lit in the colour for the higher (and so longer) value. In the picture, the time was ten past five so the minutes are shown in red up to "ten" (two o'clock) , the hours then take over and are shown up to "twenty five" (five o'clock). The seconds are shown with a single blue LED travelling up the clock and the temperature is shown by "winking" the value on a single LED every few seconds. Twelve o'clock is positioned at the top of the clock and should be visible as being slightly brighter than the other markers which indicate the five minute or hour intervals. Where a value falls exactly on one of the interval markers, the indicated value overwrites the markers. You can see in the picture the "ten" minute (two o'clock) marker is hidden by the ten minute LED, and the twenty five minute marker is overwritten by five o'clock in green. The small red LEDs on the balconies gently fade in and out, for no reason at all. The software can be adjusted so that the twelve o'clock position is anywhere on the tower. This was done for the "ring" version to allow the ring to be orientated in any angle yet still have twelve o'clock upright. In the tower this offset can be used to position twelve o'clock at the top (as here) or if it makes more sense, at the bottom with the "59"th minute at the top, or anywhere that takes your fancy really...
I wrote the description of this, took then uploaded the pictures and video to YouTube. Finally at almost 10pm last night, carried the clock through to the living room, plugged it in and sat back to enjoy watching time go by on my new clock.
Then I noticed. The colours were wrong. The description is correct, but the colours were definitely wrong. The hours should be red, minutes green. The "ring" clock had the colours right, the "Eiffel Tower" did not. Now I had added the code for the "breathing" balcony lights and a few other improvements over the last few days so I assumed I had done something that had reversed the colours. I checked all recent versions of the code against one another using DiffMerge but couldn't see anything that should have caused the colours to change. I spent ages going back through dozens of previous versions but could see no reason why. I'd changed nothing, but it was wrong. Why?
Then, the penny dropped. I realised that I had changed something. The LEDs. The original "ring" version had used SMD WS2812 devices, the "Eiffel Tower" uses through hole devices. When I was drawing the PCB and I had the (Chinese) datasheet open trying to create the footprint for the devices I had seen that it implied that the 24bit value for controlling the colour and brightness levels of the LED was different though I had wondered if this was just poor translation or poor understanding and hadn't thought of it since. As it turns out, one of the devices has the colour level sequence "0xRRGGBB" and one has the red and green channels swapped "0xGGRRBB" (both being hexadecimal values). As my hours and minutes colours are pure red, and pure green this had the effect of appearing to swap the hours for the minutes, leaving blue for the seconds working normally and the "hour" markers being white with equal levels of R, G and B also working normally. No wonder I didn't initially notice.
I put in a conditional define ( #Define SwapRGB) and then put an "#IfDef SwapRGB" along with "IfnDef SwapRGB" into my colour and brightness routine which has the colour channels swapped or not swapped, recompiled and the colours were corrected. Phew! This does mean that the pictures and video are "wrong", but I'll just have to live with that.
If you can't get to Paris in the springtime, how about bringing Paris into the home? Yes, you've guessed it. Another clock. This time modelled on the Eiffel Tower. Years ago Elektor designed one styled to look like the Rhine Tower, this is my take on that inspiration. It stands 50cm tall, with 60 through hole WS2812 addressable RGB LEDs along with 9 3mm red LEDs on the "balconies" and top of the tower. The colour of the LEDs is lost a little in the pictures and video. The reflection in the oven hob shows the colours more as they are seen with the eye. The software is identical to that of the WS2812 "ring" clock and can be found there. The recent re-write of that software to include the "overlap" and "part" modes were written in anticipation of these PCBs being delivered. For a linear clock I thought that having "hands" wasn't going to work. The picture and the YouTube video both show the clock operating in what I call "part" mode, where the lowest (and hence shortest) value of either hours or minutes is shown in full in the relevant colour for hours (green) or minutes (red) with the remainder of the display being lit in the colour for the higher (and so longer) value. In the picture, the time was ten past five so the minutes are shown in red up to "ten" (two o'clock) , the hours then take over and are shown up to "twenty five" (five o'clock). The seconds are shown with a single blue LED travelling up the clock and the temperature is shown by "winking" the value on a single LED every few seconds. Twelve o'clock is positioned at the top of the clock and should be visible as being slightly brighter than the other markers which indicate the five minute or hour intervals. Where a value falls exactly on one of the interval markers, the indicated value overwrites the markers. You can see in the picture the "ten" minute (two o'clock) marker is hidden by the ten minute LED, and the twenty five minute marker is overwritten by five o'clock in green. The small red LEDs on the balconies gently fade in and out, for no reason at all. The software can be adjusted so that the twelve o'clock position is anywhere on the tower. This was done for the "ring" version to allow the ring to be orientated in any angle yet still have twelve o'clock upright. In the tower this offset can be used to position twelve o'clock at the top (as here) or if it makes more sense, at the bottom with the "59"th minute at the top, or anywhere that takes your fancy really...
YouTube video: https://youtu.be/_35orIUTbg8
Last edit: mkstevo 2021-02-11
I wrote the description of this, took then uploaded the pictures and video to YouTube. Finally at almost 10pm last night, carried the clock through to the living room, plugged it in and sat back to enjoy watching time go by on my new clock.
Then I noticed. The colours were wrong. The description is correct, but the colours were definitely wrong. The hours should be red, minutes green. The "ring" clock had the colours right, the "Eiffel Tower" did not. Now I had added the code for the "breathing" balcony lights and a few other improvements over the last few days so I assumed I had done something that had reversed the colours. I checked all recent versions of the code against one another using DiffMerge but couldn't see anything that should have caused the colours to change. I spent ages going back through dozens of previous versions but could see no reason why. I'd changed nothing, but it was wrong. Why?
Then, the penny dropped. I realised that I had changed something. The LEDs. The original "ring" version had used SMD WS2812 devices, the "Eiffel Tower" uses through hole devices. When I was drawing the PCB and I had the (Chinese) datasheet open trying to create the footprint for the devices I had seen that it implied that the 24bit value for controlling the colour and brightness levels of the LED was different though I had wondered if this was just poor translation or poor understanding and hadn't thought of it since. As it turns out, one of the devices has the colour level sequence "0xRRGGBB" and one has the red and green channels swapped "0xGGRRBB" (both being hexadecimal values). As my hours and minutes colours are pure red, and pure green this had the effect of appearing to swap the hours for the minutes, leaving blue for the seconds working normally and the "hour" markers being white with equal levels of R, G and B also working normally. No wonder I didn't initially notice.
I put in a conditional define ( #Define SwapRGB) and then put an "#IfDef SwapRGB" along with "IfnDef SwapRGB" into my colour and brightness routine which has the colour channels swapped or not swapped, recompiled and the colours were corrected. Phew! This does mean that the pictures and video are "wrong", but I'll just have to live with that.
The code is in my original clock description here: https://sourceforge.net/p/gcbasic/discussion/projects&guides/thread/bc72c17c40/#c9a8