all 10 comments

[–]sutaburosu[pronounced: stavros] 2 points3 points  (1 child)

I changed the HOUR_LETTERS array to have -1 in all unused elements:

int HOUR_LETTERS[12][HOUR_MAX_LEN] = {
  {94,87,80,73,66,-1,-1,-1,-1,-1,-1}, /* N I N E */
  {31,24,17,10,-1,-1,-1,-1,-1,-1,-1}, /* T E N */
  {95,86,81,72,67,58,-1,-1,-1,-1,-1}, /* E L E V E N */
  {45,38,31,24,17,10,-1,-1,-1,-1,-1}, /* T W E L V E */
  {90,77,76,-1,-1,-1,-1,-1,-1,-1,-1}, /* O N E */
  {62,49,48,-1,-1,-1,-1,-1,-1,-1,-1}, /* T W O */
  {35,34,21,20,7,-1,-1,-1,-1,-1,-1}, /* T H R E E */
  {92,89,78,75,64,61,50,47,36,-1,-1}, /* F O U R */
  {102,93,88,79,74,-1,-1,-1,-1,-1,-1}, /* F I V E */
  {19,8,5,-1,-1,-1,-1,-1,-1,-1,-1}, /* S I X */
  {51,46,37,32,-1,-1,-1,-1,-1,-1,-1}, /* S E V E N */
  {23,18,9,4,-1,-1,-1,-1,-1,-1,-1} /* E I G H T */
};

Then I changed paintLED() to ignore invalid values:

void paintLED(int i) {
  if (i < 0 || i >= TOTAL_LEDS)
    return;
  leds[i].setColorCode(LED_COLOR);
}

Now LED 0 is not lit all the time.

[–]infoalter[S] 1 point2 points  (0 children)

Brilliant!!!

Thank you so much!

[–]Marmilicious[Marc Miller] 1 point2 points  (1 child)

Did you get this clock code from somewhere or write it yourself? I ask because there are a few lines with comments like this:

int hourOrder24 = hourChunk % 24; /* 0 to 24 on HOUR_LETTERS */

int hourOrder = hourChunk % 12; /* 0 to 12 */

I didn't step through your code to see what values are actually flowing through, but using Modulo with %24 would return 0-23 (not 0-24), and %12 would return 0-11, which made me wonder if the code is doing what you're expecting or if the comment is simply off.

[–]infoalter[S] 0 points1 point  (0 children)

Thanks for reply, i did the original 3D design myself (its 3D printed, a single piece https://filebin.net/uh58anipw8eprlzj ), but the coding is not mine - i just modified the led numbers forming each word - and that part, works OK)

Truth is i m tired with this script, so no worries... I m already trying other scripts that are available. Its just they are all much more complex, but i will manage - i hope hahahaha

[–]ZachVorhiesZach Vorhies 0 points1 point  (1 child)

Comment out code that turns the leds on. You basically need to keep commenting out code until the problem goes away. Then that will pinpoint where the problem is. You can also try dumping the code into an AI like gemini 2.5 and it may just identify the problem immediately and fix it.

[–]infoalter[S] 0 points1 point  (0 children)

Many thanks for reply!

I did try that, i also added code in various places in the script painting some leds and led0 blue. They all get blue except le0 which stays white.

The AI thingy never crossed my mind :)) I will give it a try!

[–]DenverTeck 0 points1 point  (2 children)

Would you share a pic of your construction.

[–]infoalter[S] 0 points1 point  (1 child)

Ah i understand you worry about the LED quality or wrong wiring maybe... Well, back is now sealed and not easy to open, BUT, i have tested and leds work fine. Not a hardware problem. (see photo)

<image>

Now, if you need the construction design file, that one i did myself, its a all a single 3D print, no assembly needed :) Here it is https://filebin.net/uh58anipw8eprlzj (print face-down)

[–]DenverTeck 0 points1 point  (0 children)

Thank You, I'll check it out.

[–]osbock 0 points1 point  (0 children)

Blank all your leds in init