Analog led clock with arduino and RTC and 74hc595

hello
i have a code that is from instrucables:
https://www.instructables.com/LED-Mega-Clock/
please download and see the codes in this site(LED_Mega_Clock.ino)
the code is beloow:


/*
LED-CLOCK V1.0
Arduino Mega 2560
K. Michalsky
28.10.14
*/


#include "Tlc5940.h"
#include <Time.h> 
#include "Wire.h"
#define DS1307_ADDRESS 0x68

int dataPin = 2;              // The Serial Data Pin to the Shift Register
int latchPin = 3;             // The Latch Pin to the Shift Register
int clockPin = 4 ;            // The Clock Pin to the Shift Register

// RGB LED Strip Pins
int blueStrip = 5;
int redStrip = 6;
int greenStrip = 7;

int interval = 1;             // Variable for delay
int const cycle = 9;          // constante for cycles (LED-Strip)

int lum = 500;                // birghtness for digit display
int CA[] = {38,39,40,41};     // Anodes for digit display


// Definition of registers arrays for blue LEDs
int register1[] = {0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         1,2,4,8,16,32,64,128};
int register2[] = {0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         1,2,4,8,16,32,64,128,    0,0,0,0,0,0,0,0};
int register3[] = {0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         1,2,4,8,16,32,64,128,    0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0};
int register4[] = {0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         1,2,4,8,16,32,64,128,    0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0};
int register5[] = {0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         1,2,4,56,16,32,64,128,   0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0};
int register6[] = {0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         1,2,4,8,16,32,64,128,    0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0};
int register7[] = {0,0,0,0,0,0,0,0,         1,2,4,56,16,32,64,128,   0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0};
int register8[] = {1,2,4,8,16,32,64,128,    0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0,         0,0,0,0,0,0,0,0};




// Array for for blue LEDs cathodes
int pin[] = {22,23,24,25,26,27,28,29};


// Definition of pins as output and Tlc setup
void setup()
{
  Wire.begin();
  Serial.begin(9600);
  
  pinMode(dataPin, OUTPUT);
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  
  for (int i=0; i < 8; i++){
    pinMode(pin[i], OUTPUT);
  }
  Tlc.init();
    for(int n=0; n < 4; n++){
      pinMode(CA[n], OUTPUT);
    }
}

void loop(){

  program_1();
  

}

program1 is:

// Set blue LEDs on for second, minute, and hour indicator
void blueLedClock(){
  int second = bcdToDec(Wire.read());
  int minute = bcdToDec(Wire.read());
  int hour = bcdToDec(Wire.read());
  
  // second indicator of blue LEDs
  shift(second);
  for(int i=0; i< 7; i++){
    digitalWrite(pin[i], HIGH);
    }						 
  delay(interval);
  for(int i=0; i< 7; i++){
    digitalWrite(pin[i], LOW);
    }
  delay(interval);
  
  // minute indicator of blue LEDs
  shift(minute); 
  delay(interval);
  for(int i=0; i< 8; i++){
    digitalWrite(pin[i], HIGH);
  }
  delay(interval);

  // hour indicator of blue LEDs
    if(hour < 12){
      if(minute < 12){
        shift(hour*5);
        for(int i=2; i< 8; i++){
          digitalWrite(pin[i], HIGH);
        }						
        delay(interval);
        for(int i=0; i< 8; i++){
         digitalWrite(pin[i], LOW);
        }
      }else
      if(minute >= 12 && minute < 24){
        shift(hour*5+1);
        for(int i=2; i< 8; i++){
          digitalWrite(pin[i], HIGH);
        }						
        delay(interval);
        for(int i=0; i< 8; i++){
          digitalWrite(pin[i], LOW);
        }
      }else
      if(minute >= 24 && minute < 36){
        shift(hour*5+2);
        for(int i=2; i< 8; i++){
          digitalWrite(pin[i], HIGH);
        }						
        delay(interval);
        for(int i=0; i< 8; i++){
          digitalWrite(pin[i], LOW);
        }
      }else
      if(minute >= 36 && minute < 48){
        shift(hour*5+3);
        for(int i=2; i< 8; i++){
          digitalWrite(pin[i], HIGH);
        }						
        delay(interval);
        for(int i=0; i< 8; i++){
          digitalWrite(pin[i], LOW);
        }
      }else
      if(minute >= 48){
        shift(hour*5+4);
        for(int i=2; i< 8; i++){
          digitalWrite(pin[i], HIGH);
        }						
        delay(interval);
        for(int i=0; i< 8; i++){
          digitalWrite(pin[i], LOW);
        }
      }
    }else
    for(int i=12; i < 24; i++){
    if(hour == i){
      if(minute < 12){
        shift((i-12)*5);
        for(int i=2; i< 8; i++){
          digitalWrite(pin[i], HIGH);
        }						
        delay(interval);
        for(int i=0; i< 8; i++){
          digitalWrite(pin[i], LOW);
        }
      }else
      if(minute >= 12 && minute < 24){
        shift((i-12)*5+1);
        for(int i=2; i< 8; i++){
          digitalWrite(pin[i], HIGH);
        }						
        delay(interval);
        for(int i=0; i< 8; i++){
          digitalWrite(pin[i], LOW);
        }
      }else
      if(minute >= 24 && minute < 36){
        shift((i-12)*5+2);
        for(int i=2; i< 8; i++){
          digitalWrite(pin[i], HIGH);
        }						
        delay(interval);
        for(int i=0; i< 8; i++){
          digitalWrite(pin[i], LOW);
        }
      }else
      if(minute >= 36 && minute < 48){
        shift((i-12)*5+3);
        for(int i=2; i< 8; i++){
          digitalWrite(pin[i], HIGH);
        }						
        delay(interval);
        for(int i=0; i< 8; i++){
          digitalWrite(pin[i], LOW);
        }
      }else
      if(minute >= 48){
        shift((i-12)*5+4);
        for(int i=2; i< 8; i++){
          digitalWrite(pin[i], HIGH);
        }						
        delay(interval);
        for(int i=0; i< 8; i++){
          digitalWrite(pin[i], LOW);
        }
      }
    }
  }
}

// Shift Data
void shift(int var){
  digitalWrite(latchPin, LOW);
  digitalWrite(29, HIGH);
  digitalWrite(28, HIGH);
  shiftOut(dataPin, clockPin, MSBFIRST, register1[var]);
  shiftOut(dataPin, clockPin, MSBFIRST, register2[var]);
  shiftOut(dataPin, clockPin, MSBFIRST, register3[var]);
  shiftOut(dataPin, clockPin, MSBFIRST, register4[var]);
  shiftOut(dataPin, clockPin, MSBFIRST, register5[var]);
  shiftOut(dataPin, clockPin, MSBFIRST, register6[var]);
  shiftOut(dataPin, clockPin, MSBFIRST, register7[var]);
  shiftOut(dataPin, clockPin, MSBFIRST, register8[var]); 
  digitalWrite(latchPin, HIGH);
}

the code is for build an analog led clock with arduino and rtc and shift register. the clock has three simple indicators(second, minutes, hour). but i would like change the indicators hands with special graphic shapes. like below images:
302592-2011-3-10-9-48-17

I think I need to change the array values ​​but I can't
can any one help me for have three various indicators?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.