hello here I have a fain clock with a ring wall clock 60 ws2812 I find a code its working (and for once the library also XD)

here is the code

#include <Wire.h>
#include <RTClib.h>
#include <Adafruit_NeoPixel.h>

#define PIN 6
#define PIXEL 60

Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL, PIN, NEO_GRB + NEO_KHZ800);

RTC_DS1307 RTC; // Establish clock object
DateTime Clock; // Holds current clock time

byte hourval, minuteval, secondval;

void setup() {
  Wire.begin();          // Begin I2C
  RTC.begin();   // begin clock
    if (! RTC.isrunning()) {
//  Serial.println("RTC is NOT running!");
  // following line sets the RTC to the date & time this sketch was compiled

//  RTC.adjust(DateTime(__DATE__, __TIME__));
  strip.begin();; // Initialize all pixels to 'off'


void loop() {

    Clock =; // get the RTC time
    secondval = Clock.second();  // get seconds
    minuteval = Clock.minute();  // get minutes
    hourval = Clock.hour();   // get hours

    if(hourval > 11) hourval -= 12; // This clock is 12 hour, if 13-23, convert to 0-11
    hourval = (hourval*60 + minuteval) / 12;   
    strip.setPixelColor(hourval, 0x008080);strip.setPixelColor(hourval-1, 0x004040);strip.setPixelColor(hourval+1, 0x004040);
//    strip.setPixelColor(hourval-2, 0x001010);strip.setPixelColor(hourval+2, 0x001010);
    strip.setPixelColor(minuteval, 0x800080);
//    strip.setPixelColor(minuteval-1, 0x200020);strip.setPixelColor(minuteval+1, 0x200020);
    strip.setPixelColor(secondval, 0x808000);//strip.setPixelColor(secondval-1, 0x002F00);strip.setPixelColor(secondval+1, 0x002F00);;
    strip.setPixelColor(hourval, 0x000000);strip.setPixelColor(hourval-1, 0x000000);strip.setPixelColor(hourval+1, 0x000000);
    strip.setPixelColor(hourval-2, 0x000000);strip.setPixelColor(hourval+2, 0x000000);
    strip.setPixelColor(minuteval, 0x000000);strip.setPixelColor(minuteval-1, 0x000000);strip.setPixelColor(minuteval+1, 0x000000);
    strip.setPixelColor(secondval, 0x000000);//strip.setPixelColor(secondval-1, 0x000000);strip.setPixelColor(secondval+1, 0x000000);

   Serial.print(hourval, DEC);
  Serial.print(minuteval, DEC);
   Serial.println(secondval, DEC);


how do we do so that it is not on 60 leds my 15 30 or 45 leds (I have to change the #define led 60 with its value not working

how do we do so that it is not on 60 leds my 15 30 or 45 leds (I have to change the #define led 60 with its value not working

The hour has 60 minutes, the minute has 60 seconds. How would you display that fact with 45 LEDs?
You can scale your hourval, minuteval and secondval by the available LEDs but that might be different than what you expect.