How to reverse the direction of the LED strip by 180 degrees

Hello to all Arduino Forensics. I need some help, please.
I have an Arduino code for a LED strip clock, which is working correctly, but here's the problem: the wiring for the original circuit is coming from the top of the clock and I would like it to come from the bottom (foot) of the clock. So, is there any function in the code to reverse this wiring, so that I don't have to change the hardware? I would appreciate any help.

#include <ESP8266WiFi.h>
#include <Adafruit_NeoPixel.h>
#include "TimeClient.h"

#define PIN D5 // r400 --> DIN led
#define LEDNUM 60
#define BRIGHTNESS 40

int Q = (LEDNUM / 12);
int zero = 0;
int five =  Q;
int ten =    Q * 2;
int fifteen =   Q * 3;
int twenty = Q * 4;
int twentyfive = Q * 5;
int therty = Q * 6;
int thertyfive = Q * 7;
int fourty = Q * 8;
int fourtyfive = Q * 9;
int fifty = Q * 10;
int fiftyfive = Q * 11;

long lastUpdate = millis();
long lastSecond = millis();

String hours, minutes, seconds;
int currentSecond, currentMinute, currentHour;

char ssid[] = "ssid";     // your network SSID (name)
char pass[] = "password"; // your network password

const float UTC_OFFSET = 7; // Brasil = -3
TimeClient timeClient(UTC_OFFSET);

Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN);

void setup() {
  Serial.begin(115200);
  strip.begin();
  strip.setBrightness(BRIGHTNESS);
  strip.show();

  WiFi.begin(ssid, pass);
  while (WiFi.status() != WL_CONNECTED) {
    rainbowCycle(5);
    rainbowCycle2(5);
  }

  timeClient.updateTime();
  updateTime() ;
  lastUpdate = millis();
  lastSecond = millis();

  meteorRain(0, 0, 255, 10, 64, false, 15);
}

void loop() {
  if ((millis() - lastUpdate) > 1800000) updateTime();

  if ((millis() - lastSecond) > 1000) {
    strip.setPixelColor(currentSecond - 1 , 0, 0, 0);
    strip.setPixelColor(currentSecond, 0, 0, 0);
    strip.setPixelColor(currentMinute, 0, 0, 0);
    strip.setPixelColor(currentHour * 5 - 1, 0, 0, 0);
    strip.setPixelColor(currentHour * 5, 0, 0, 0);
    strip.setPixelColor(currentHour * 5 + 1, 0, 0, 0);
    strip.show();

    lastSecond = millis();
    currentSecond++;

    if (currentSecond > 59) {
      currentSecond = 0;
      currentMinute++;
      if (currentMinute > 59) {
        currentMinute = 0;
        currentHour++;
        if (currentHour > 12) currentHour = 1;
      }
    }

    String currentTime = String(currentHour) + ':' + String(currentMinute) + ':' + String(currentSecond);
    Serial.println(currentTime);

    //if (currentMinute == 0 && currentSecond == 0) {  //meteor rain every hour
    //if (currentMinute == 0 && currentMinute == 30 && currentSecond == 0) {  //meteor rain every half hour

    if ((currentMinute == 0 || currentMinute == 5 || currentMinute == 10 || currentMinute == 15 || currentMinute == 20 || currentMinute == 25 || currentMinute == 30 || currentMinute == 35 || currentMinute == 40 || currentMinute == 45 || currentMinute == 50 || currentMinute == 55) && (currentSecond == 0) ) {  //meteor rain every five minute
      meteorRain(0, 0, 255, 10, 64, false, 15);
      currentSecond++;
    } else {
      strip.setPixelColor(zero, 125, 125, 125);
      strip.setPixelColor(five, 10, 10, 10);
      strip.setPixelColor(ten, 10, 10, 10);
      strip.setPixelColor(fifteen, 125, 125, 125);
      strip.setPixelColor(twenty, 10, 10, 10);
      strip.setPixelColor(twentyfive, 10, 10, 10);
      strip.setPixelColor(therty, 125, 125, 125);
      strip.setPixelColor(thertyfive, 10, 10, 10);
      strip.setPixelColor(fourty, 10, 10, 10);
      strip.setPixelColor(fourtyfive, 125, 125, 125);
      strip.setPixelColor(fifty, 10, 10, 10);
      strip.setPixelColor(fiftyfive, 10, 10, 10);

      if (currentHour == 12) {
        strip.setPixelColor(59, 255, 0, 0);
        strip.setPixelColor(0, 255, 0, 0);
        strip.setPixelColor(1, 255, 0, 0);
      } else {
        strip.setPixelColor(currentHour * 5 - 1, 255, 0, 0);
        strip.setPixelColor(currentHour * 5, 255, 0, 0);
        strip.setPixelColor(currentHour * 5 + 1, 255, 0, 0);
      }

      strip.setPixelColor(currentMinute, 0, 255, 0);
      strip.setPixelColor(currentSecond, 0, 0, 255);
      strip.setPixelColor(currentSecond - 1 , 0, 0, 255);
      strip.show();
    }
  }
}

void updateTime() {
  hours = timeClient.getHours();
  minutes = timeClient.getMinutes();
  seconds = timeClient.getSeconds();
  currentHour = hours.toInt();
  if (currentHour > 12) currentHour = currentHour - 12;
  currentMinute = minutes.toInt();
  currentSecond = seconds.toInt();
  lastUpdate = millis();
}



void rainbowCycle(uint8_t wait) {
  uint16_t i, j;

  for (j = 0; j < 256; j++) { // 5 cycles of all colors on wheel
    for (i = 0; i < 60; i++) {
      strip.setPixelColor(i, Wheel(((i * 256 / 60) + j) & 255));
    }
    strip.show();
    delay(wait);
  }
}

void rainbowCycle2(uint8_t wait) {
  uint16_t i, j;

  for (j = 256; j > 0; j--) { // 5 cycles of all colors on wheel
    for (i = 0; i < 60; i++) {
      strip.setPixelColor(i, Wheel(((i * 256 / 60) + j) & 255));
    }
    strip.show();
    delay(wait);
  }
}

uint32_t Wheel(byte WheelPos) {
  WheelPos = 255 - WheelPos;
  if (WheelPos < 85) {
    return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
  }
  if (WheelPos < 170) {
    WheelPos -= 85;
    return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
  }
  WheelPos -= 170;
  return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}

void meteorRain(byte red, byte green, byte blue, byte meteorSize, byte meteorTrailDecay, boolean meteorRandomDecay, int SpeedDelay) {
  setAll(0, 0, 0);

  for (int i = 60; i > LEDNUM - LEDNUM; i--) {
    for (int j = 0; j < LEDNUM; j++) {
      if ( (!meteorRandomDecay) || (random(10) > 5) ) {
        fadeToBlack(j, meteorTrailDecay );
      }
    }
    for (int j = 0; j < meteorSize; j++) {
      if ( ( i - j < LEDNUM) && (i - j >= 0) ) {
        setPixel(i - j, red, green, blue);
      }
    }
    strip.show();
    delay(SpeedDelay);
  }

  for (int i = 0; i < LEDNUM + LEDNUM; i++) {
    for (int j = 0; j < LEDNUM; j++) {
      if ( (!meteorRandomDecay) || (random(10) > 5) ) {
        fadeToBlack(j, meteorTrailDecay );
      }
    }
    for (int j = 0; j < meteorSize; j++) {
      if ( ( i - j < LEDNUM) && (i - j >= 0) ) {
        setPixel(i - j, red, green, blue);
      }
    }
    strip.show();
    delay(SpeedDelay);
  }
}

void fadeToBlack(int ledNo, byte fadeValue) {
#ifdef ADAFRUIT_NEOPIXEL_H
  // NeoPixel
  uint32_t oldColor;
  uint8_t r, g, b;
  int value;

  oldColor = strip.getPixelColor(ledNo);
  r = (oldColor & 0x00ff0000UL) >> 16;
  g = (oldColor & 0x0000ff00UL) >> 8;
  b = (oldColor & 0x000000ffUL);

  r = (r <= 10) ? 0 : (int) r - (r * fadeValue / 256);
  g = (g <= 10) ? 0 : (int) g - (g * fadeValue / 256);
  b = (b <= 10) ? 0 : (int) b - (b * fadeValue / 256);

  strip.setPixelColor(ledNo, r, g, b);
#endif
#ifndef ADAFRUIT_NEOPIXEL_H
  // FastLED
  leds[ledNo].fadeToBlackBy( fadeValue );
#endif
}

void setPixel(int Pixel, byte red, byte green, byte blue) {
#ifdef ADAFRUIT_NEOPIXEL_H
  // NeoPixel
  strip.setPixelColor(Pixel, strip.Color(red, green, blue));
#endif
#ifndef ADAFRUIT_NEOPIXEL_H
  // FastLED
  leds[Pixel].r = red;
  leds[Pixel].g = green;
  leds[Pixel].b = blue;
#endif
}

void setAll(byte red, byte green, byte blue) {
  for (int i = 0; i < LEDNUM; i++ ) {
    setPixel(i, red, green, blue);
  }
  strip.show();
}

There is not function, but you can make one. Since you are using an ESP8266, there will be plenty of memory. Just create a second led strip

Adafruit_NeoPixel real_strip = Adafruit_NeoPixel(60, PIN);

and then, everywhere in you code when you have strip.show, replace that with a call to a function that just copies strip to real_strip but in reverse and calls real_strip.show() instead.

@blh64
First of all, thanks for the reply, but did you understand me? Or did I not understand you because you said: "Just create a second LED strip".
I simply want the connection cables of the LED strip (whether one or two strips) to come out of the base and not from the top of the strip. Do you understand?

Another thing: I didn't understand what the difference is between:
Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN);
and:
Adafruit_NeoPixel real_strip = Adafruit_NeoPixel(60, PIN);

Excuse my mistake; I put here the original Arduino code (for one strip) but, in fact, I added one more strip, leaving with two, one for Hours and another for Minutes and Seconds, which is this other one:

#include <ESP8266WiFi.h>
#include <Adafruit_NeoPixel.h>
#include "TimeClient.h"

#define PIN 1  //DIN da primeira tira de Led (para Horas)
#define PIN2 2  //DIN da segunda tira de Led (para Minutos e Segundos)
#define LEDNUM 60
#define BRIGHTNESS 95

int Q = (LEDNUM / 12);
int zero = 0;
int five = Q;
int ten = Q * 2;
int fifteen = Q * 3;
int twenty = Q * 4;
int twentyfive = Q * 5;
int therty = Q * 6;
int thertyfive = Q * 7;
int fourty = Q * 8;
int fourtyfive = Q * 9;
int fifty = Q * 10;
int fiftyfive = Q * 11;

long lastUpdate = millis();
long lastSecond = millis();

String hours, minutes, seconds;
int currentSecond, currentMinute, currentHour;

char ssid[] = "ssid";     // seu SSID de rede (nome)
char pass[] = "xxxxxxxx"; // sua senha de rede

const float UTC_OFFSET = -3; // Brasil = -3
TimeClient timeClient(UTC_OFFSET);

Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN);
Adafruit_NeoPixel strip2 = Adafruit_NeoPixel(60, PIN2);

void setup() {
  Serial.begin(115200);
  strip.begin();
  strip2.begin();
  strip.setBrightness(BRIGHTNESS);
  strip2.setBrightness(BRIGHTNESS);
  strip.show();
  strip2.show();

  WiFi.begin(ssid, pass);
  while (WiFi.status() != WL_CONNECTED) {
    rainbowCycle(5);
    rainbowCycle2(5);
  }

  timeClient.updateTime();
  updateTime() ;
  lastUpdate = millis();
  lastSecond = millis();

  meteorRain(0, 0, 255, 10, 64, false, 15);
}

void loop() {
  if ((millis() - lastUpdate) > 1800000) updateTime();

  if ((millis() - lastSecond) > 1000) {
  //strip2.setPixelColor(currentSecond - 1 , 0, 0, 0);  //para piscar 2 leds no ponteiro dos Segundos
    strip2.setPixelColor(currentSecond, 0, 0, 0);
    strip2.setPixelColor(currentMinute, 0, 0, 0);
    strip.setPixelColor(currentHour * 5 - 1, 0, 0, 0);
    strip.setPixelColor(currentHour * 5, 0, 0, 0);
    strip.setPixelColor(currentHour * 5 + 1, 0, 0, 0);
    strip.show();
    strip2.show();

    lastSecond = millis();
    currentSecond++;

    if (currentSecond > 59) {
      currentSecond = 0;
      currentMinute++;
      if (currentMinute > 59) {
        currentMinute = 0;
        currentHour++;
        if (currentHour > 12) currentHour = 1;
      }
    }

    String currentTime = String(currentHour) + ':' + String(currentMinute) + ':' + String(currentSecond);
    Serial.println(currentTime);

    //if (currentMinute == 0 && currentSecond == 0) {  //meteor rain a cada hora
    //if (currentMinute == 0 && currentMinute == 30 && currentSecond == 0) {  //meteor rain a cada meia hora

    if ((currentMinute == 0 || currentMinute == 5 || currentMinute == 10 || currentMinute == 15 || currentMinute == 20 || currentMinute == 25 || currentMinute == 30 || currentMinute == 35 || currentMinute == 40 || currentMinute == 45 || currentMinute == 50 || currentMinute == 55) && (currentSecond == 0) ) { //meteor rain a cada cinco minutos
      meteorRain(0, 0, 255, 10, 64, false, 15);
      currentSecond++;
    }

    else {
      strip2.setPixelColor(zero, 32, 0, 20); //púrpura
      strip2.setPixelColor(five, 1, 3, 10); //azul fraco
      strip2.setPixelColor(ten, 1, 3, 10);
      strip2.setPixelColor(fifteen, 32, 0, 20);
      strip2.setPixelColor(twenty, 1, 3, 10);
      strip2.setPixelColor(twentyfive, 1, 3, 10);
      strip2.setPixelColor(therty, 32, 0, 20);
      strip2.setPixelColor(thertyfive, 1, 3, 10);
      strip2.setPixelColor(fourty, 1, 3, 10);
      strip2.setPixelColor(fourtyfive, 32, 0, 20);
      strip2.setPixelColor(fifty, 1, 3, 10);
      strip2.setPixelColor(fiftyfive, 1, 3, 10);

      if (currentHour == 12) {
        strip.setPixelColor(59, 255, 0, 0);
        strip.setPixelColor(0, 255, 0, 0);
        strip.setPixelColor(1, 255, 0, 0);
      }

      else {
        strip.setPixelColor(currentHour * 5 - 1, 255, 0, 0);
        strip.setPixelColor(currentHour * 5, 255, 0, 0);
        strip.setPixelColor(currentHour * 5 + 1, 255, 0, 0);
      }

      strip2.setPixelColor(currentMinute, 0, 255, 0);
      strip2.setPixelColor(currentSecond, 0, 0, 255);
    //strip2.setPixelColor(currentSecond - 1 , 0, 0, 255);  //para piscar 2 leds no ponteiro dos Segundos
      strip.show();
      strip2.show();
    }
  }
}

void updateTime() {
  hours = timeClient.getHours();
  minutes = timeClient.getMinutes();
  seconds = timeClient.getSeconds();
  currentHour = hours.toInt();
  if (currentHour > 12) currentHour = currentHour - 12;
  currentMinute = minutes.toInt();
  currentSecond = seconds.toInt();
  lastUpdate = millis();
}

void rainbowCycle(uint8_t wait) {
  uint16_t i, j;

  for (j = 0; j < 256; j++) {  // 5 ciclos de todas as cores na roda
    for (i = 0; i < 60; i++) {
      strip.setPixelColor(i, Wheel(((i * 256 / 60) + j) & 255));
    }
    strip.show();
    strip2.show();
    delay(wait);
  }
}

void rainbowCycle2(uint8_t wait) {
  uint16_t i, j;

  for (j = 256; j > 0; j--) {  // 5 ciclos de todas as cores na roda
    for (i = 0; i < 60; i++) {
      strip.setPixelColor(i, Wheel(((i * 256 / 60) + j) & 255));
    }
    strip.show();
    strip2.show();
    delay(wait);
  }
}

uint32_t Wheel(byte WheelPos) {
  WheelPos = 255 - WheelPos;
  if (WheelPos < 85) {
    return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
  }
  if (WheelPos < 170) {
    WheelPos -= 85;
    return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
  }
  WheelPos -= 170;
  return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}

void meteorRain(byte red, byte green, byte blue, byte meteorSize, byte meteorTrailDecay, boolean meteorRandomDecay, int SpeedDelay) {
  setAll(0, 0, 0);

  for (int i = 60; i > LEDNUM - LEDNUM; i--) {
    for (int j = 0; j < LEDNUM; j++) {
      if ( (!meteorRandomDecay) || (random(10) > 5) ) {
        fadeToBlack(j, meteorTrailDecay );
      }
    }
    for (int j = 0; j < meteorSize; j++) {
      if ( ( i - j < LEDNUM) && (i - j >= 0) ) {
        setPixel(i - j, red, green, blue);
      }
    }
    strip.show();
    strip2.show();
    delay(SpeedDelay);
  }

  for (int i = 0; i < LEDNUM + LEDNUM; i++) {
    for (int j = 0; j < LEDNUM; j++) {
      if ( (!meteorRandomDecay) || (random(10) > 5) ) {
        fadeToBlack(j, meteorTrailDecay );
      }
    }
    for (int j = 0; j < meteorSize; j++) {
      if ( ( i - j < LEDNUM) && (i - j >= 0) ) {
        setPixel(i - j, red, green, blue);
      }
    }
    strip.show();
    strip2.show();
    delay(SpeedDelay);
  }
}

void fadeToBlack(int ledNo, byte fadeValue) {
#ifdef ADAFRUIT_NEOPIXEL_H
  // NeoPixel
  uint32_t oldColor;
  uint8_t r, g, b;
  int value;

  oldColor = strip.getPixelColor(ledNo);
  oldColor = strip2.getPixelColor(ledNo);
  r = (oldColor & 0x00ff0000UL) >> 16;
  g = (oldColor & 0x0000ff00UL) >> 8;
  b = (oldColor & 0x000000ffUL);

  r = (r <= 10) ? 0 : (int) r - (r * fadeValue / 256);
  g = (g <= 10) ? 0 : (int) g - (g * fadeValue / 256);
  b = (b <= 10) ? 0 : (int) b - (b * fadeValue / 256);

  strip.setPixelColor(ledNo, r, g, b);
  strip2.setPixelColor(ledNo, r, g, b);
#endif
#ifndef ADAFRUIT_NEOPIXEL_H
  // FastLED
  leds[ledNo].fadeToBlackBy( fadeValue );
#endif
}

void setPixel(int Pixel, byte red, byte green, byte blue) {
#ifdef ADAFRUIT_NEOPIXEL_H
  // NeoPixel
  strip.setPixelColor(Pixel, strip.Color(red, green, blue));
  strip2.setPixelColor(Pixel, strip2.Color(red, green, blue));
#endif
#ifndef ADAFRUIT_NEOPIXEL_H
  // FastLED
  leds[Pixel].r = red;
  leds[Pixel].g = green;
  leds[Pixel].b = blue;
#endif
}

void setAll(byte red, byte green, byte blue) {
  for (int i = 0; i < LEDNUM; i++ ) {
    setPixel(i, red, green, blue);
  }
  strip.show();
  strip2.show();
}

What they meant was to create a second instance of the Adafruit_NeoPixel class.

That is also the reason for the real_strip variable. With your updated code, I suppose that you will also need a real_strip2 instance.

Hey @Dancopy - this is a bit of language that you must pick up on. It is saying that you will control two widgets that control the LEDs. All you need to do is follow examples. They all work the same. Don't get hung up on terms.

Here is an example of reversing the strip...

#include <Adafruit_NeoPixel.h> // the name of the library
#define PIN        6 // pin for neopixel
#define NUMPIXELS 16 // number of neopixels
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); // "NUMPIXELS" and "PIN" are used here

int value = 100; // arbitrary delay value
bool j; // generic counter

void setup() {
  pixels.begin(); // INITIALIZE neopixel
}

void loop() {
  pixels.clear(); // Set all pixel colors to 'off'
  j = !j; // two cycles - j = 0 and j = 1
  for (byte i = 0; i < NUMPIXELS; i++) { // For each pixel...
    if (j) // if j == 1... do this...
      pixels.setPixelColor(i, pixels.Color(0, 150, 0)); // pick a pixel {i} and a color (red, grn, blu)
    else // if j == 0... do this...
      pixels.setPixelColor((NUMPIXELS) - i, pixels.Color(0, 150, 0)); // make it brighter
    if ((i == 0) || (i == NUMPIXELS))
      pixels.setPixelColor(i, pixels.Color(191, 255, 0));
    pixels.show(); // show the update
    delay(value); // keep pixel on briefly
    pixels.clear();
    pixels.show(); // show the update
  }
}

I seem to agree with the idea that you want the strip to operate backwards, that is to say the first LED 0 should be at the other end of the strip where 59 is, 1 where 58 is and so forth.

The proposal is to just write the strip the way you do, but not show() that strip, rather you would copy it to another strip (stripBackwards I've called it here) and then show() that second strip.

  for (byte ii = 0; ii < 60; ii++)
    stripBackwards.setPixelColor(ii, strip.getPixelColor(59 - ii));

  stripBackwards.show();

Obvsly I hope as @grb pointed out if you have two strips in your sketch, yo7ll have to do the same trick on both. You can probably use the stripBackwards strip for both as the backwards copy is only needed right at the time of showing the strips.

Or you mean something completely different I do not understand yet.

a7

Note that the pin assigned to stripBackwards would need to be changed to correspond to the LED strip being driven. The Adafruit library does allow this.

An alternative method is to literally go though the strip and reverse the order of the LEDs before calling show(). It may be necessary to then reverse the order again, if the sketch will be modifying the current contents instead of re-writing the entire LED array.
Something like the following (untested):

void stripShowReversed() {
  uint32_t temp;
  for (uint16_t i = 0, j = LEDNUM - 1; i < j; i++, j--) {
    temp = strip.getPixelColor(i);
    strip.setPixelColor(i, strip.getPixelColor(j));
    strip.setPixelColor(j, temp);
  }
  strip.show();
  for (uint16_t i = 0, j = LEDNUM - 1; i < j; i++, j--) {
    temp = strip.getPixelColor(i);
    strip.setPixelColor(i, strip.getPixelColor(j));
    strip.setPixelColor(j, temp);
  }
}

Use Find & Replace all in the IDE

Find:

.setPixelColor(

Replace:

.setPixelColor(59 - 

Thank you to everyone who is helping me and, answering @alto777's question here, I have made a drawing available here to demonstrate what I want.


Note here, that the numbers 12 .......... 11 should remain as they are. I just want the Cables, instead of coming out of the Top, to come out of the Base of the Clock.

If you could, please, replace the updated code (two strips) as it should be, I would be very grateful as I have great difficulty understanding this coding.

PS: Maybe I created confusion in the topic title but in the description I talked about reversing the cables.

I have provided a drawing to demonstrate what I want. In other words, I do not want the LEDs to be inverted, but rather that the cables come out of the Clock Base instead of coming out of the Top.

Can you not physically turn the strips upside down? I think you are saying you would like to drive the steps from the bottom but if you just moved the data wire you would be driving the output instead of the input. If you can remount the strip you can fix the rest in software.

What is stopping you from doing this?

I am with @EmilyJane and @xfpd… if you want the cables to come out the bottom, why can't you just route them down from the top and out the bottom? Extend the wires if you are constrained by their lengths at this time.

Or as we all thought, turn the strips upside down and fix it in software to be not upside down…

Perhaps if you took a few pictures and tried to explain why you can't just.

a7

You will need to physically remove the numbers from the led strips, turn them 180°, and re-attach them in the preferred orientation. This task cannot be done via software.

After you have physically re-arranged the hardware, then you can use software approaches to make the clock display work is it did previously.

You only have to worry about the Data In connection since you can drive power and ground from either end. If running a Data In wire down from the top is not feasible for some cosmetic reason you might be able to solve the problem with copper foil tape that will lie perfectly flat and could be run down the edge of the strip so as not to stick up.
As everyone has asked though, a picture would go a long way to helping understand what your goal is.

You can use one continuous LED strand of 60 and run seconds, minutes and hours.

#include <Adafruit_NeoPixel.h>
#define PIN  4 // NeoPixel pin
#define PIX 72 // Number of NeoPixels 5 x 8)
Adafruit_NeoPixel leds = Adafruit_NeoPixel(PIX, PIN, NEO_GRB + NEO_KHZ800);

unsigned long timer, timeout = 100; // milliseconds
byte seconds, minutes, hours;

void setup() {
  Serial.begin(115200); // initialize serial communications
  leds.begin(); // initialize Neopixel object/instance
  leds.clear(); // clear display buffer
  leds.show();  // display pixel buffer
}

void loop() {
  if (millis() - timer > timeout) {
    timer = millis();

    seconds++;

    if (seconds == 60) {
      seconds = 0;
      minutes++;
    }

    if (minutes == 60) {
      minutes = 0;
      hours++;
    }

    if (hours == 12) {
      hours = 0;
    }

    leds.clear();
    leds.setPixelColor(seconds, leds.Color(255, 0, 0)); // seconds (red)
    leds.setPixelColor(minutes, leds.Color(0, 255, 0)); // minutes (green)
    leds.setPixelColor(hours, leds.Color(0, 0, 255)); // hourss (blue)
    leds.show();
  }
}
diagram.json for wokwi
{
  "version": 1,
  "author": "foreignpigdog x",
  "editor": "wokwi",
  "parts": [
    { "type": "wokwi-arduino-nano", "id": "nano", "top": -4.8, "left": 201.1, "attrs": {} },
    {
      "type": "wokwi-resistor",
      "id": "r3",
      "top": -24.85,
      "left": 316.8,
      "attrs": { "value": "470" }
    },
    { "type": "wokwi-vcc", "id": "vcc1", "top": -28.04, "left": 412.8, "attrs": {} },
    { "type": "wokwi-gnd", "id": "gnd1", "top": 48, "left": 373.8, "attrs": {} },
    { "type": "wokwi-gate-and-2", "id": "and1", "top": 9.6, "left": 422.4, "attrs": {} },
    {
      "type": "wokwi-text",
      "id": "text1",
      "top": 19.2,
      "left": 451.2,
      "attrs": { "text": "E-cap" }
    },
    {
      "type": "wokwi-text",
      "id": "text2",
      "top": 0,
      "left": 451.2,
      "attrs": { "text": "1000uF" }
    },
    {
      "type": "wokwi-neopixel-matrix",
      "id": "ring1",
      "top": -142.2,
      "left": 247.35,
      "attrs": { "pixleate": "1", "rows": "5", "cols": "12" }
    }
  ],
  "connections": [
    [ "gnd1:GND", "nano:GND.3", "black", [ "v0" ] ],
    [ "vcc1:VCC", "nano:5V.2", "red", [ "v0" ] ],
    [ "vcc1:VCC", "and1:B", "red", [ "v0" ] ],
    [ "gnd1:GND", "and1:A", "black", [ "v0" ] ],
    [ "r3:2", "ring1:DIN", "green", [ "h0" ] ],
    [ "nano:4", "r3:1", "green", [ "v0" ] ],
    [ "vcc1:VCC", "ring1:VCC", "red", [ "v38.4", "h-28.8" ] ],
    [ "gnd1:GND", "ring1:GND", "black", [ "v0" ] ]
  ],
  "dependencies": {}
}

First of all, thank you to everyone who took the time to help me.
As "EmilyJane" and others here said to hide the wires inside, even though they come out of the top of the clock. Others said that this change is not possible via software.
Yes, I built the clock, with the wires coming from the inside and coming out at the base of the clock, but with the inconvenience of adding a "mess" of wires, even though they are not visible.
But, I still think that this could be done via software, but I do not have the knowledge to do so.
Finally, I thank everyone and, here is a picture of how the clock turned out for you to see.
Sorry for my English, which is not my native language.
Daniel Fernandes