// COSMIC CLOCK ATmega328
// Rev A - initial release

#include <SoftPWM.h>

byte trigger_pin = 2; // interupt pin used to trigger the start of the 'heart-beat' animation
volatile byte to_begin = 0; // variable that is altered on detection of an interupt on pin 2
#define DELAY 100
#define DELAY2 105 // was 100
uint8_t leds[12] = {0, 1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}; // the 12 LEDs are attached to the following Arduino designated pins
byte PINK_RING_ANIMATION = 0; // to change the pink LEDs animation mode

#include <EasyButton.h> // needed when using EasyButton library
#define BUTTON_ONE_PIN 3 // pin for 'altering pink led animation' button
EasyButton button1(BUTTON_ONE_PIN); // Instance of the button.

boolean PINK_MODE_CHANGED = false;
boolean CHASER_JUST_CHANGED = false;

#define BINARY_1 14 // INPUT PIN FOR LEAST SIGNIFICANT BIT OF BINARY ENCODED HOUR INFORMATION FROM ATMEGA644
#define BINARY_2 15 // INPUT PIN FOR 2ND LEAST SIGNIFICANT BIT OF BINARY ENCODED HOUR INFORMATION FROM ATMEGA644
#define BINARY_4 16 // INPUT PIN FOR 2ND MOST SIGNIFICANT BIT OF BINARY ENCODED HOUR INFORMATION FROM ATMEGA644
#define BINARY_8 17 // INPUT PIN FOR MOST SIGNIFICANT BIT OF BINARY ENCODED HOUR INFORMATION FROM ATMEGA644
#define DOT_CLOCK 18 // INPUT PIN TO SELECT WHETHER THE PINK LEDS ARE USED AS INDEX MARKERS, OR ARE USED TO DISPLAY THE CURRENT HOUR (THE MINUTES BEING DISPLAYED ON THE OUTER SECONDS RING VIA THE ATMEGA644)





// UNCOMMENT EITHER NUMBER 1 OR NUMBER 2 OR NUMBER 3 OR NUMBER 4 OR NUMBER 5 OR NUMBER 6 ('#define...' LINES DIRECTLY BELOW) HOUR-DOT LEDs ANIMATIONS TO SELECT IT, WHERE (WHEN IN HOUR-DOT TIME DISPLAY MODE, ie. the time's hour being shown by a single lit pink index LED, whilst the minutes are displayed on the outer yellow seconds ring LEDs):
// NUMBER 1. The current hour (when in hour-dot time display mode) is indicated by lighting the current hour LED at a fixed high brightness, whilst all the other 11 LEDs are at a low brightness.
// NUMBER 2. The current hour (when in hour-dot time display mode) is indicated by lighting the current hour LED at a fixed high brightness, whilst all the other 11 LEDs are unlit.
// NUMBER 3. The current hour (when in hour-dot time display mode) is indicated by pulsing brighter (in sync with a change of seond) at high brightness the current hour LED, whilst all the other 11 LEDs are at a low brightness.
// NUMBER 4. The current hour (when in hour-dot time display mode) is indicated by pulsing brighter (in sync with a change of seond) at high brightness the current hour LED, whilst all the other 11 LEDs are unlit
// NUMBER 5. The current hour (when in hour-dot time display mode) is indicated by pulsing dimmer (in sync with a change of seond) at high brightness the current hour LED, whilst all the other 11 LEDs are at a low brightness.
// NUMBER 6. The current hour (when in hour-dot time display mode) is indicated by pulsing dimmer (in sync with a change of seond) at high brightness the current hour LED, whilst all the other 11 LEDs are unlit



//#define hour_dot 1 // NUMBER 1 hour-dot LED animation (see above)
//#define hour_dot 2 // NUMBER 2 hour-dot LED animation (see above)
//#define hour_dot 3 // NUMBER 3 hour-dot LED animation (see above)
//#define hour_dot 4 // NUMBER 4 hour-dot LED animation (see above)
#define hour_dot 5 // NUMBER 5 hour-dot LED animation (see above)
//#define hour_dot 6 // NUMBER 6 hour-dot LED animation (see above)


#define auto_cycling_pin 19 // switch to define whether the pink index LEDs animation is auto cycling or not
boolean cycle = false; // to determine whether or not the pink index LEDs animation is auto cycling or not
unsigned long TFT_Millis = 0;
unsigned long TFT_Previous = 0;
const unsigned long TFT_Interval = 900000; // 6000 is a 6 second interval animation mode update - for testing only. 900000 is a 15 minute interval animation mode update which is more realistic interval for final deployment


void button1ISR()
{
  button1.read();
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void setup()
 {
	 
pinMode(BINARY_1,INPUT); // INPUT PIN FOR LEAST SIGNIFICANT BIT OF BINARY ENCODED HOUR INFORMATION FROM ATMEGA644	 
pinMode(BINARY_2,INPUT); // INPUT PIN FOR 2ND LEAST SIGNIFICANT BIT OF BINARY ENCODED HOUR INFORMATION FROM ATMEGA644	
pinMode(BINARY_4,INPUT); // INPUT PIN FOR 2ND MOST SIGNIFICANT BIT OF BINARY ENCODED HOUR INFORMATION FROM ATMEGA644	
pinMode(BINARY_8,INPUT); // INPUT PIN FOR MOST SIGNIFICANT BIT OF BINARY ENCODED HOUR INFORMATION FROM ATMEGA644	
pinMode(DOT_CLOCK,INPUT); // INPUT PIN TO SELECT WHETHER THE PINK LEDS ARE USED AS INDEX MARKERS, OR ARE USED TO DISPLAY THE CURRENT HOUR (THE MINUTES BEING DISPLAYED ON THE OUTER SECONDS RING VIA THE ATMEGA644)
	
pinMode(auto_cycling_pin,INPUT_PULLUP); // switch to define whether the pink index LEDs animation is auto cycling or not
	
  button1.begin();  // Initialize the EasyButton library for button 1.
//  button1.onPressedFor(30, Increment_PINK_RING); // if button 1 pressed for 30mSec go to 'Increment_PINK_RING' subroutine  
  
  button1.onPressed(Increment_PINK_RING);
  
  if (button1.supportsInterrupt())
  {
    button1.enableInterrupt(button1ISR);
  }
	 
//  SoftPWMBegin(); // default polarity, ie, pin is low if PWM value is 0 - for use when using npn transistors
  SoftPWMBegin(SOFTPWM_INVERTED); // inverted polarity, ie, pin is high if PWM value is 0 - for use when not using npn transistors (ie, using direct drive from Atmega328)

  
  for (byte i = 0; i < 12; i++)
  {
    SoftPWMSet(leds[i], 0); // set all LED to zero duty cycle (out of max of 255)
  }

  SoftPWMSetFadeTime(ALL, 100, 450); // This value is now defined on an individual animation basis. Sets the default fade time for LEDs attached to all above declared arduino pins as 100 ms fade-up and 450 ms to fade-down
  
  attachInterrupt(digitalPinToInterrupt(trigger_pin), trigger, RISING); // Arduino pin 2, actual pin 4 that triggers by interupt the start of the 'heart-beat' animation
 }

///////////////////////////////////////////////////////////////////////////////////////////////////////

void trigger() 
 {
  to_begin = 1;	
 }
 
///////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////// 
 
void loop() 
{
	
 TFT_Millis = millis();	
	
 if (digitalRead(auto_cycling_pin) == HIGH) 
  {
	  cycle = false;
  }
  else
  {
	  cycle = true;
  }	
  
  
  if (cycle == true) {

   if (TFT_Millis - TFT_Previous > TFT_Interval) { // every 15 minutes change the animation mode automatically		
    PINK_RING_ANIMATION = PINK_RING_ANIMATION + 1;
	if (PINK_RING_ANIMATION == 3) PINK_RING_ANIMATION = 4; // need to remove from auto-cycling animation display 'PINK_MODE_ANIMATION' mode 3, as all the LEDs are off in this mode
	if (PINK_RING_ANIMATION == 11) PINK_RING_ANIMATION = 0; // after the last animation mode wrap around back to the first animation mode
	PINK_MODE_CHANGED = true;
	CHASER_JUST_CHANGED = true;	
    TFT_Previous = TFT_Millis;
	}	
  }	 
	
	


 if (digitalRead(DOT_CLOCK) == HIGH) { // when not in dot-hour clock mode
 
 
	
//  button1.read(); //     When using the EasyButton library continuously read the status of button 1.
  
  
///////////////////////////////////////////////////////////////////////////////////////////////////////  
	
 if (PINK_RING_ANIMATION == 0) // heart-beat animation where all the 12 LEDs pulse simultaeously, synched to the seconds changing on the main Atmega328 chip (the main Atmega328 clock chip outputs a brief 10msec long pulse at the instant the seconds change, and this pulse is inputed to the interupt pin on this Atmega328)
 {
	 
  SoftPWMSetFadeTime(ALL, 100, 450); // Sets the default fade time for LEDs attached to all above declared arduino pins as 100 ms fade-up and 450 ms to fade-down
	 
  SoftPWMSetPolarity(ALL,SOFTPWM_INVERTED);
  
  
  if (PINK_MODE_CHANGED == true)
  {
   for (byte i = 0; i < 12; i++)
   {
    SoftPWMSet(leds[i], 0); // set all LED to zero duty cycle (out of max of 255) to turn all LEDS off
   }
   PINK_MODE_CHANGED = false;
  }
	
  if (to_begin == 1)
  {	  
  
   for (byte i = 0; i < 12; i++)
   {
     SoftPWMSet(leds[i], 255); // Turn on LED to max brightness by setting pwm setting to 255 (out of a max of 255)
   }

  
  // Wait for the fade-up and some extra delay.
  delay(110); // 250 original
 


   for (byte i = 0; i < 12; i++)
   {
     SoftPWMSet(leds[i], 50); // reduce LED brightness by lowering pwm setting to around 50 (out of a max of 255)
   }
 
  // Wait for the fade-down, and some extra delay.
  delay(460); // 650 original
  
  to_begin = 0;
  
  }
  
  
 } // end of 'if (PINK_RING_ANIMATION == 0)'
 
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
  if (PINK_RING_ANIMATION == 1) // inverted chaser trailing LEDs - alternating clockwise then anticlockwise once per revolution
 {

// THE 'SoftPWMSetFadeTime' values may need fine tuning, along with the 'delay' values, as when this code was originally written the 'SoftPWMSetFadeTime' values were tailored for the 'Heartbeat' animation, and I never thought about changing them for other fade-dependent animations. (maybe the fade-up and fade-down value should be the same, eg, 300)
  SoftPWMSetFadeTime(ALL, 100, 450); // Sets the default fade time for LEDs attached to all above declared arduino pins as 100 ms fade-up and 450 ms to fade-down

  SoftPWMSetPolarity(ALL,SOFTPWM_NORMAL);
  CHASER_JUST_CHANGED = false;
  
  if (PINK_MODE_CHANGED == true)
  {
   for (byte i = 0; i < 12; i++)
   {
    SoftPWMSet(leds[i], 0); // set all LED to zero duty cycle (out of max of 255) to turn all LEDS off
   }
   PINK_MODE_CHANGED = false;
  }
  
  for (byte i = 0; i < 12; i++) // was 'for (byte i = 0; i < 7; i++)'
  {
    SoftPWMSet(leds[i+1], 255);
    SoftPWMSet(leds[i], 0); // was 'SoftPWMSet(leds[i], 0)' so as to turn LEDs fully off so that trails are most prominent. NOTE - GO BACK TO TURNING THE LEDS FULLY OFF IF THE TRAILS LOOK TOO BAD BECAUSE THE LEDS ARE PERMANENTLY LIT AT A LOW INTENSITY
    delay(DELAY2);
//	button1.read(); //     When using the EasyButton library continuously read the status of button 1.
  }
 
//  button1.read(); //     When using the EasyButton library continuously read the status of button 1.
  delay(400);//ORIGINAL
//  button1.read(); //     When using the EasyButton library continuously read the status of button 1.
  
  
  if (CHASER_JUST_CHANGED == false) // added so that if the mode change button is pressed we're NOT going to have to wait a further about 1.6 secs for the mode change to actually occur, instead, the worst case (longest you'll have to wait) is about 1.6 secs - as opposed to about 3.2 secs before
  { 

    for (byte i = 12; i > 0; i--) // was 'for (byte i = 7; i > 0; i--)'
     {
       SoftPWMSet(leds[i-1], 255);
       SoftPWMSet(leds[i], 0); // was 'SoftPWMSet(leds[i], 0)' so as to turn LEDs fully off so that trails are most prominent. NOTE - GO BACK TO TURNING THE LEDS FULLY OFF IF THE TRAILS LOOK TOO BAD BECAUSE THE LEDS ARE PERMANENTLY LIT AT A LOW I
       delay(DELAY2);
//       button1.read(); //     When using the EasyButton library continuously read the status of button 1.
     }

//   button1.read(); //     When using the EasyButton library continuously read the status of button 1.
   delay(400); // ORIGINAL
//   button1.read(); //     When using the EasyButton library continuously read the status of button 1.
  }
  
 } // end of 'if (PINK_RING_ANIMATION == 1)'
 
 
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


 
 if (PINK_RING_ANIMATION == 2) // random twinkling of LEDs
 {
	 
  SoftPWMSetFadeTime(ALL, 100, 450); // Sets the default fade time for LEDs attached to all above declared arduino pins as 100 ms fade-up and 450 ms to fade-down	 

  SoftPWMSetPolarity(ALL,SOFTPWM_INVERTED);
  
  if (PINK_MODE_CHANGED == true)
  {
   for (byte i = 0; i < 12; i++)
   {
    SoftPWMSet(leds[i], 0); // set all LED to zero duty cycle (out of max of 255) to turn all LEDS off
   }
   PINK_MODE_CHANGED = false;
  }
  

  uint8_t pin = random(12);
  
  SoftPWMSet(leds[pin], 255);
  delay(50);
  SoftPWMSet(leds[pin], 50); 

  delay(random(DELAY));
  
  
 } // end of 'if (PINK_RING_ANIMATION == 2)'
 
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
  if (PINK_RING_ANIMATION == 3) // all LEDS off
 {
	 
  SoftPWMSetFadeTime(ALL, 100, 450); // Values here are not important as there's no fading up or fading down going on. Sets the default fade time for LEDs attached to all above declared arduino pins as 100 ms fade-up and 450 ms to fade-down	 
	 
  SoftPWMSetPolarity(ALL,SOFTPWM_INVERTED);
  
  
  if (PINK_MODE_CHANGED == true)
  {
   for (byte i = 0; i < 12; i++)
   {
    SoftPWMSet(leds[i], 0); // set all LED to zero duty cycle (out of max of 255) to turn all LEDS off
   }
   PINK_MODE_CHANGED = false;
  }

  for (byte i = 0; i < 12; i++)
  {
    SoftPWMSet(leds[i], 0); // set all LED to zero duty cycle (out of max of 255), ie, all off
  }
  
 } // end of 'if (PINK_RING_ANIMATION == 3)'
 
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
   if (PINK_RING_ANIMATION == 4)  // continously rotating clockwise trailing chaser
 {

// THE 'SoftPWMSetFadeTime' values may need fine tuning, along with the 'delay' values, as when this code was originally written the 'SoftPWMSetFadeTime' values were tailored for the 'Heartbeat' animation, and I never thought about changing them for other fade-dependent animations. (maybe the fade-up and fade-down value should be the same, eg, 300)
  SoftPWMSetFadeTime(ALL, 100, 450); // Sets the default fade time for LEDs attached to all above declared arduino pins as 100 ms fade-up and 450 ms to fade-down

  SoftPWMSetPolarity(ALL,SOFTPWM_INVERTED);
  
  if (PINK_MODE_CHANGED == true)
  {
   for (byte i = 0; i < 12; i++)
   {
    SoftPWMSet(leds[i], 0); // set all LED to zero duty cycle (out of max of 255) to turn all LEDS off
   }
   PINK_MODE_CHANGED = false;
  }   
  

  for (byte i = 0; i < 12; i++) // was 'for (byte i = 0; i < 7; i++)'
  {
    SoftPWMSet(leds[i+1], 255); // was 'SoftPWMSet(leds[i+1], 255'
    SoftPWMSet(leds[i], 0); // was 'SoftPWMSet(leds[i], 0)' so as to turn LEDs fully off so that trails are most prominent. NOTE - GO BACK TO TURNING THE LEDS FULLY OFF IF THE TRAILS LOOK TOO BAD BECAUSE THE LEDS ARE PERMANENTLY LIT AT A LOW INTENSITY
    delay(DELAY2);
//	button1.read(); //     When using the EasyButton library continuously read the status of button 1.
  }
 
 
 } // end of 'if (PINK_RING_ANIMATION == 4)'
 
 
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 

   if (PINK_RING_ANIMATION == 5)  // all LEDs on
 {
	 
  SoftPWMSetFadeTime(ALL, 100, 450); // Values here are not important as there's no fading up or fading down going on. Sets the default fade time for LEDs attached to all above declared arduino pins as 100 ms fade-up and 450 ms to fade-down	 
	 
  SoftPWMSetPolarity(ALL,SOFTPWM_INVERTED);	 
  
  if (PINK_MODE_CHANGED == true)
  {
   for (byte i = 0; i < 12; i++)
   {
    SoftPWMSet(leds[i], 0); // set all LED to zero duty cycle (out of max of 255) to turn all LEDS off
   }
   PINK_MODE_CHANGED = false;
  }  
  

  for (byte i = 0; i < 12; i++)
  {
    SoftPWMSet(leds[i], 255); // set all LED to 255 duty cycle (out of max of 255), ie, all on
  }

  
 } // end of 'if (PINK_RING_ANIMATION == 5)'
 
 
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


   if (PINK_RING_ANIMATION == 6)  // trailing chaser LEDs - alternating clockwise then anticlockwise once per revolution
 {

// THE 'SoftPWMSetFadeTime' values may need fine tuning, along with the 'delay' values, as when this code was originally written the 'SoftPWMSetFadeTime' values were tailored for the 'Heartbeat' animation, and I never thought about changing them for other fade-dependent animations. (maybe the fade-up and fade-down value should be the same, eg, 300)	 
  SoftPWMSetFadeTime(ALL, 100, 450); // Sets the default fade time for LEDs attached to all above declared arduino pins as 100 ms fade-up and 450 ms to fade-down
	 
  SoftPWMSetPolarity(ALL,SOFTPWM_INVERTED); 
  CHASER_JUST_CHANGED = false;
  
  if (PINK_MODE_CHANGED == true)
  {
   for (byte i = 0; i < 12; i++)
   {
    SoftPWMSet(leds[i], 0); // set all LED to zero duty cycle (out of max of 255) to turn all LEDS off
   }
   PINK_MODE_CHANGED = false;
  }

  for (byte i = 0; i < 12; i++) // was 'for (byte i = 0; i < 7; i++)'
  {
    SoftPWMSet(leds[i+1], 255);
    SoftPWMSet(leds[i], 0); // was 'SoftPWMSet(leds[i], 0)' so as to turn LEDs fully off so that trails are most prominent. NOTE - GO BACK TO TURNING THE LEDS FULLY OFF IF THE TRAILS LOOK TOO BAD BECAUSE THE LEDS ARE PERMANENTLY LIT AT A LOW INTENSITY
    delay(DELAY2);
//    button1.read(); //     When using the EasyButton library continuously read the status of button 1.
  }

//  button1.read(); //     When using the EasyButton library continuously read the status of button 1.  
  delay(400);
//  button1.read(); //     When using the EasyButton library continuously read the status of button 1.
  
  
  
  if (CHASER_JUST_CHANGED == false) // added so that if the mode change button is pressed we're NOT going to have to wait a further about 1.6 secs for the mode change to actually occur, instead, the worst case (longest you'll have to wait) is about 1.6 secs - as opposed to about 3.2 secs before
  {
  
    for (byte i = 12; i > 0; i--) // was 'for (byte i = 7; i > 0; i--)'
    {
     SoftPWMSet(leds[i-1], 255);
     SoftPWMSet(leds[i], 0); // was 'SoftPWMSet(leds[i], 0)' so as to turn LEDs fully off so that trails are most prominent. NOTE - GO BACK TO TURNING THE LEDS FULLY OFF IF THE TRAILS LOOK TOO BAD BECAUSE THE LEDS ARE PERMANENTLY LIT AT A LOW I
     delay(DELAY2);
//     button1.read(); //     When using the EasyButton library continuously read the status of button 1.
    }

//   button1.read(); //     When using the EasyButton library continuously read the status of button 1.
   delay(400);
//   button1.read(); //     When using the EasyButton library continuously read the status of button 1.
   }
  
  } // end of 'if (PINK_RING_ANIMATION == 6)'
 
 
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 

   if (PINK_RING_ANIMATION == 7)  // Clockwise only chaser (with LEDs fully off when not active) starting in sync with seconds changing
{
	 
// THE 'SoftPWMSetFadeTime' values may need fine tuning, along with the 'delay' values, as when this code was originally written the 'SoftPWMSetFadeTime' values were tailored for the 'Heartbeat' animation, and I never thought about changing them for other fade-dependent animations. (maybe the fade-up and fade-down value should be the same, eg, 300)	 
  SoftPWMSetFadeTime(ALL, 70, 70); // Sets the default fade time for LEDs attached to all above declared arduino pins as 100 ms fade-up and 450 ms to fade-down
	 
  SoftPWMSetPolarity(ALL,SOFTPWM_INVERTED); 
  CHASER_JUST_CHANGED = false;

  if (PINK_MODE_CHANGED == true)
  {
   for (byte i = 0; i < 12; i++)
   {
    SoftPWMSet(leds[i], 0); // set all LED to zero duty cycle (out of max of 255) to turn all LEDS off
   }
   PINK_MODE_CHANGED = false;
  }
  

  if (to_begin == 1)
  {	 
   for (byte i = 0; i < 12; i++) // was 'for (byte i = 0; i < 7; i++)'
   {
    SoftPWMSet(leds[i+1], 255);
    SoftPWMSet(leds[i], 0); // was 'SoftPWMSet(leds[i], 0)' so as to turn LEDs fully off so that trails are most prominent. NOTE - GO BACK TO TURNING THE LEDS FULLY OFF IF THE TRAILS LOOK TOO BAD BECAUSE THE LEDS ARE PERMANENTLY LIT AT A LOW INTENSITY
    delay(71);
   }
//   delay(10);
   to_begin = 0;
  }
  
} // end of 'if (PINK_RING_ANIMATION == 7)'
 
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 

   if (PINK_RING_ANIMATION == 8)  // Clockwise only chaser (with LEDs dim when not active) starting in sync with seconds changing
{
	 
// THE 'SoftPWMSetFadeTime' values may need fine tuning, along with the 'delay' values, as when this code was originally written the 'SoftPWMSetFadeTime' values were tailored for the 'Heartbeat' animation, and I never thought about changing them for other fade-dependent animations. (maybe the fade-up and fade-down value should be the same, eg, 300)	 
  SoftPWMSetFadeTime(ALL, 70, 70); // Sets the default fade time for LEDs attached to all above declared arduino pins as 100 ms fade-up and 450 ms to fade-down
	 
  SoftPWMSetPolarity(ALL,SOFTPWM_INVERTED); 
  CHASER_JUST_CHANGED = false;

  if (PINK_MODE_CHANGED == true)
  {
   for (byte i = 0; i < 12; i++)
   {
    SoftPWMSet(leds[i], 0); // set all LED to zero duty cycle (out of max of 255) to turn all LEDS off
   }
   PINK_MODE_CHANGED = false;
  }
  

  if (to_begin == 1)
  {	 
   for (byte i = 0; i < 12; i++) // was 'for (byte i = 0; i < 7; i++)'
   {
    SoftPWMSet(leds[i+1], 255);
    SoftPWMSet(leds[i], 50); // was 'SoftPWMSet(leds[i], 0)' so as to turn LEDs fully off so that trails are most prominent. NOTE - GO BACK TO TURNING THE LEDS FULLY OFF IF THE TRAILS LOOK TOO BAD BECAUSE THE LEDS ARE PERMANENTLY LIT AT A LOW INTENSITY
    delay(71);
   }
//   delay(10);
   to_begin = 0;
  }
  
} // end of 'if (PINK_RING_ANIMATION == 8)'
 
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

   if (PINK_RING_ANIMATION == 9)  // Inverted version of: 'Clockwise only chaser (with LEDs fully off when not active) starting in sync with seconds changing'
{
	 
// THE 'SoftPWMSetFadeTime' values may need fine tuning, along with the 'delay' values, as when this code was originally written the 'SoftPWMSetFadeTime' values were tailored for the 'Heartbeat' animation, and I never thought about changing them for other fade-dependent animations. (maybe the fade-up and fade-down value should be the same, eg, 300)	 
  SoftPWMSetFadeTime(ALL, 70, 70); // Sets the default fade time for LEDs attached to all above declared arduino pins as 100 ms fade-up and 450 ms to fade-down
	 
  SoftPWMSetPolarity(ALL,SOFTPWM_NORMAL); 
  CHASER_JUST_CHANGED = false;

  if (PINK_MODE_CHANGED == true)
  {
   for (byte i = 0; i < 12; i++)
   {
    SoftPWMSet(leds[i], 0); // set all LED to zero duty cycle (out of max of 255) to turn all LEDS off
   }
   PINK_MODE_CHANGED = false;
  }
  

  if (to_begin == 1)
  {	 
   for (byte i = 0; i < 12; i++) // was 'for (byte i = 0; i < 7; i++)'
   {
    SoftPWMSet(leds[i+1], 255);
    SoftPWMSet(leds[i], 0); // was 'SoftPWMSet(leds[i], 0)' so as to turn LEDs fully off so that trails are most prominent. NOTE - GO BACK TO TURNING THE LEDS FULLY OFF IF THE TRAILS LOOK TOO BAD BECAUSE THE LEDS ARE PERMANENTLY LIT AT A LOW INTENSITY
    delay(71);
   }
//   delay(10);
   to_begin = 0;
  }
  
} // end of 'if (PINK_RING_ANIMATION == 9)'

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

   if (PINK_RING_ANIMATION == 10)  // Inverted version of: 'continously rotating clockwise trailing chaser'
 {

// THE 'SoftPWMSetFadeTime' values may need fine tuning, along with the 'delay' values, as when this code was originally written the 'SoftPWMSetFadeTime' values were tailored for the 'Heartbeat' animation, and I never thought about changing them for other fade-dependent animations. (maybe the fade-up and fade-down value should be the same, eg, 300)
  SoftPWMSetFadeTime(ALL, 100, 450); // Sets the default fade time for LEDs attached to all above declared arduino pins as 100 ms fade-up and 450 ms to fade-down

  SoftPWMSetPolarity(ALL,SOFTPWM_NORMAL);
  
  if (PINK_MODE_CHANGED == true)
  {
   for (byte i = 0; i < 12; i++)
   {
    SoftPWMSet(leds[i], 0); // set all LED to zero duty cycle (out of max of 255) to turn all LEDS off
   }
   PINK_MODE_CHANGED = false;
  }   
  

  for (byte i = 0; i < 12; i++) // was 'for (byte i = 0; i < 7; i++)'
  {
    SoftPWMSet(leds[i+1], 255); // was 'SoftPWMSet(leds[i+1], 255'
    SoftPWMSet(leds[i], 0); // was 'SoftPWMSet(leds[i], 0)' so as to turn LEDs fully off so that trails are most prominent. NOTE - GO BACK TO TURNING THE LEDS FULLY OFF IF THE TRAILS LOOK TOO BAD BECAUSE THE LEDS ARE PERMANENTLY LIT AT A LOW INTENSITY
    delay(DELAY2);
//	button1.read(); //     When using the EasyButton library continuously read the status of button 1.
  }
 
 
 } // end of 'if (PINK_RING_ANIMATION == 10)'
 
} // end of ' if (digitalRead(DOT_CLOCK) == HIGH)'


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// START OF 6 POSSIBLE ANIMATIONS FOR THE SINGLE LIT PINK INDEX LED THAT SHOWS THE CURRENT HOUR WHEN IN HOUR-DOT TIME DISPLAY MODE, WHERE:

// NUMBER 1. The current hour is indicated by lighting the current hour LED at a fixed high brightness, whilst all the other 11 LEDs are at a low brightness.
// NUMBER 2. The current hour is indicated by lighting the current hour LED at a fixed high brightness, whilst all the other 11 LEDs are unlit
// NUMBER 3. The current hour is indicated by pulsing brighter (in sync with a change of second) at high brightness the current hour LED, whilst all the other 11 LEDs are at a low brightness.
// NUMBER 4. The current hour is indicated by pulsing brighter (in sync with a change of second) at high brightness the current hour LED, whilst all the other 11 LEDs are unlit
// NUMBER 5. The current hour is indicated by pulsing dimmer (in sync with a change of second) at high brightness the current hour LED, whilst all the other 11 LEDs are at a low brightness.
// NUMBER 6. The current hour is indicated by pulsing dimmer (in sync with a change of second) at high brightness the current hour LED, whilst all the other 11 LEDs are unlit

 if (digitalRead(DOT_CLOCK) == LOW) { // if in dot-hour clock mode


// NUMBER 1 start. Highlighted lit current hour LED is at a fixed high brightness, other LEDs dim

if (hour_dot == 1) { // Highlighted lit current hour LED is at a fixed high brightness, other LEDs dim
 

	 
//  SoftPWMSetFadeTime(ALL, 100, 450); // Sets the default fade time for LEDs attached to all above declared arduino pins as 100 ms fade-up and 450 ms to fade-down
  SoftPWMSetFadeTime(ALL, 200, 200); // NOT ACTUALLY IMPORTANT WHAT THE VALUES ARE IN THIS NUMBER 1 AS THERE IS NO FADING UP OR FADING DOWN - EXCEPT AT THE CHANGE OF THE HOUR. Sets the default fade time for LEDs attached to all above declared arduino pins as 200 ms fade-up and 200 ms to fade-down
	 
  SoftPWMSetPolarity(ALL,SOFTPWM_INVERTED);
	 
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == LOW)) { // if hour is 0/12 light LED 1 (out of 12), ie top pink LED
	for (byte i = 1; i < 12; i++)
     {
     SoftPWMSet(leds[i], 25); // set all but current hour LEDs to 25 duty cycle (out of max of 255), ie, very dim
     }
	SoftPWMSet(leds[0], 255); // set hour 0/12 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
   }
   
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == LOW)) { // if hour is 1 light LED 2 (out of 12)
	SoftPWMSet(leds[0], 25); // set hour 0/12 LED to 25 duty cycle (out of max of 255), ie, very dim
	for (byte i = 2; i < 12; i++)
     {
     SoftPWMSet(leds[i], 25); // set rest of LEDs (except the current hour LED) to 25 duty cycle (out of max of 255), ie, very dim
     }
	SoftPWMSet(leds[1], 255); // set hour 1 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
   }
   
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == LOW)) { // if hour is 2 light LED 3 (out of 12)
	SoftPWMSet(leds[0], 25); // set hour 0/12 LED to 25 duty cycle (out of max of 255), ie, very dim
	SoftPWMSet(leds[1], 25); // set hour 1 LED to 25 duty cycle (out of max of 255), ie, very dim
	for (byte i = 3; i < 12; i++)
     {
     SoftPWMSet(leds[i], 25); // set rest of LEDs (except the current hour LED) to 25 duty cycle (out of max of 255), ie, very dim
     }
	SoftPWMSet(leds[2], 255); // set hour 2 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
   }
   
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == LOW)) { // if hour is 3 light LED 4 (out of 12)
	SoftPWMSet(leds[0], 25); // set hour 0/12 LED to 25 duty cycle (out of max of 255), ie, very dim
	SoftPWMSet(leds[1], 25); // set hour 1 LED to 25 duty cycle (out of max of 255), ie, very dim
	SoftPWMSet(leds[2], 25); // set hour 2 LED to 25 duty cycle (out of max of 255), ie, very dim
	for (byte i = 4; i < 12; i++)
     {
     SoftPWMSet(leds[i], 25); // set rest of LEDs (except the current hour LED) to 25 duty cycle (out of max of 255), ie, very dim
     }
	SoftPWMSet(leds[3], 255); // set hour 3 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
   }
   
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == HIGH) && (digitalRead(BINARY_8) == LOW)) { // if hour is 4 light LED 5 (out of 12)
	for (byte i = 0; i < 4; i++)
     {
     SoftPWMSet(leds[i], 25); // set LEDs prior to current hour LED to 25 duty cycle (out of max of 255), ie, very dim
     }
	for (byte i = 5; i < 12; i++)
     {
     SoftPWMSet(leds[i], 25); // set rest of LEDs (except the current hour LED) to 25 duty cycle (out of max of 255), ie, very dim
     }
	SoftPWMSet(leds[4], 255); // set hour 4 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
   }
   
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == HIGH) && (digitalRead(BINARY_8) == LOW)) { // if hour is 5 light LED 6 (out of 12)
	for (byte i = 0; i < 5; i++)
     {
     SoftPWMSet(leds[i], 25); // set LEDs prior to current hour LED to 25 duty cycle (out of max of 255), ie, very dim
     }
	for (byte i = 6; i < 12; i++)
     {
     SoftPWMSet(leds[i], 25); // set rest of LEDs (except the current hour LED) to 25 duty cycle (out of max of 255), ie, very dim
     }
	SoftPWMSet(leds[5], 255); // set hour 5 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
   }
   
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == HIGH) && (digitalRead(BINARY_8) == LOW)) { // if hour is 6 light LED 7 (out of 12)
	for (byte i = 0; i < 6; i++)
     {
     SoftPWMSet(leds[i], 25); // set LEDs prior to current hour LED to 25 duty cycle (out of max of 255), ie, very dim
     }
	for (byte i = 7; i < 12; i++)
     {
     SoftPWMSet(leds[i], 25); // set rest of LEDs (except the current hour LED) to 25 duty cycle (out of max of 255), ie, very dim
     }
	SoftPWMSet(leds[6], 255); // set hour 6 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
   }
   
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == HIGH) && (digitalRead(BINARY_8) == LOW)) { // if hour is 7 light LED 8 (out of 12)
	for (byte i = 0; i < 7; i++)
     {
     SoftPWMSet(leds[i], 25); // set LEDs prior to current hour LED to 25 duty cycle (out of max of 255), ie, very dim
     }
	for (byte i = 8; i < 12; i++)
     {
     SoftPWMSet(leds[i], 25); // set rest of LEDs (except the current hour LED) to 25 duty cycle (out of max of 255), ie, very dim
     }
	SoftPWMSet(leds[7], 255); // set hour 7 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
   }
   
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == HIGH)) { // if hour is 8 light LED 9 (out of 12)
	for (byte i = 0; i < 8; i++)
     {
     SoftPWMSet(leds[i], 25); // set LEDs prior to current hour LED to 25 duty cycle (out of max of 255), ie, very dim
     }
	for (byte i = 9; i < 12; i++)
     {
     SoftPWMSet(leds[i], 25); // set rest of LEDs (except the current hour LED) to 25 duty cycle (out of max of 255), ie, very dim
     }
	SoftPWMSet(leds[8], 255); // set hour 8 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
   }
   
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == HIGH)) { // if hour is 9 light LED 10 (out of 12)
	for (byte i = 0; i < 9; i++)
     {
     SoftPWMSet(leds[i], 25); // set LEDs prior to current hour LED to 25 duty cycle (out of max of 255), ie, very dim
     }
	for (byte i = 10; i < 12; i++)
     {
     SoftPWMSet(leds[i], 25); // set rest of LEDs (except the current hour LED) to 25 duty cycle (out of max of 255), ie, very dim
     }
	SoftPWMSet(leds[9], 255); // set hour 9 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
   }
   
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == HIGH)) { // if hour is 10 light LED 11 (out of 12)
	for (byte i = 0; i < 10; i++)
     {
     SoftPWMSet(leds[i], 25); // set LEDs prior to current hour LED to 25 duty cycle (out of max of 255), ie, very dim
     }
	SoftPWMSet(leds[11], 25); // set hour 11 LED to 25 duty cycle (out of max of 255), ie, very dim
	SoftPWMSet(leds[10], 255); // set hour 10 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
   }
   
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == HIGH)) { // if hour is 11 light LED 12 (out of 12)
	for (byte i = 0; i < 11; i++)
     {
     SoftPWMSet(leds[i], 25); // set LEDs prior to current hour LED to 25 duty cycle (out of max of 255), ie, very dim
     }
	SoftPWMSet(leds[11], 255); // set hour 11 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
   }


 
 // NUMBER 1 end.
 
}
 
 
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 // NUMBER 2 start. Highlighted lit current hour LED is at a fixed high brightness, other LEDs unlit

if (hour_dot == 2) { // Highlighted lit current hour LED is at a fixed high brightness, other LEDs unlit
 
	 
//  SoftPWMSetFadeTime(ALL, 100, 450); // Sets the default fade time for LEDs attached to all above declared arduino pins as 100 ms fade-up and 450 ms to fade-down
  SoftPWMSetFadeTime(ALL, 200, 200); // NOT ACTUALLY IMPORTANT WHAT THE VALUES ARE IN THIS NUMBER 1 AS THERE IS NO FADING UP OR FADING DOWN - EXCEPT AT THE CHANGE OF THE HOUR. Sets the default fade time for LEDs attached to all above declared arduino pins as 200 ms fade-up and 200 ms to fade-down
	 
  SoftPWMSetPolarity(ALL,SOFTPWM_INVERTED);
	 
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == LOW)) { // if hour is 0/12 light LED 1 (out of 12), ie top pink LED
	for (byte i = 1; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set all but current hour LEDs to 0 duty cycle (out of max of 255), ie, off
     }
	SoftPWMSet(leds[0], 255); // set hour 0/12 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
   }
   
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == LOW)) { // if hour is 1 light LED 2 (out of 12)
	SoftPWMSet(leds[0], 0); // set hour 0/12 LED to 0 duty cycle (out of max of 255), ie, off
	for (byte i = 2; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
	SoftPWMSet(leds[1], 255); // set hour 1 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
   }
   
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == LOW)) { // if hour is 2 light LED 3 (out of 12)
	SoftPWMSet(leds[0], 0); // set hour 0/12 LED to 0 duty cycle (out of max of 255), ie, off
	SoftPWMSet(leds[1], 0); // set hour 1 LED to 0 duty cycle (out of max of 255), ie, off
	for (byte i = 3; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
	SoftPWMSet(leds[2], 255); // set hour 2 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
   }
   
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == LOW)) { // if hour is 3 light LED 4 (out of 12)
	SoftPWMSet(leds[0], 0); // set hour 0/12 LED to 0 duty cycle (out of max of 255), ie, off
	SoftPWMSet(leds[1], 0); // set hour 1 LED to 0 duty cycle (out of max of 255), ie, off
	SoftPWMSet(leds[2], 0); // set hour 2 LED to 0 duty cycle (out of max of 255), ie, off
	for (byte i = 4; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
	SoftPWMSet(leds[3], 255); // set hour 3 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
   }
   
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == HIGH) && (digitalRead(BINARY_8) == LOW)) { // if hour is 4 light LED 5 (out of 12)
	for (byte i = 0; i < 4; i++)
     {
     SoftPWMSet(leds[i], 0); // set LEDs prior to current hour LED to 0 duty cycle (out of max of 255), ie, off
     }
	for (byte i = 5; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
	SoftPWMSet(leds[4], 255); // set hour 4 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
   }
   
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == HIGH) && (digitalRead(BINARY_8) == LOW)) { // if hour is 5 light LED 6 (out of 12)
	for (byte i = 0; i < 5; i++)
     {
     SoftPWMSet(leds[i], 0); // set LEDs prior to current hour LED to 0 duty cycle (out of max of 255), ie, off
     }
	for (byte i = 6; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
	SoftPWMSet(leds[5], 255); // set hour 5 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
   }
   
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == HIGH) && (digitalRead(BINARY_8) == LOW)) { // if hour is 6 light LED 7 (out of 12)
	for (byte i = 0; i < 6; i++)
     {
     SoftPWMSet(leds[i], 0); // set LEDs prior to current hour LED to 0 duty cycle (out of max of 255), ie, off
     }
	for (byte i = 7; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
	SoftPWMSet(leds[6], 255); // set hour 6 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
   }
   
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == HIGH) && (digitalRead(BINARY_8) == LOW)) { // if hour is 7 light LED 8 (out of 12)
	for (byte i = 0; i < 7; i++)
     {
     SoftPWMSet(leds[i], 0); // set LEDs prior to current hour LED to 0 duty cycle (out of max of 255), ie, off
     }
	for (byte i = 8; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
	SoftPWMSet(leds[7], 255); // set hour 7 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
   }
   
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == HIGH)) { // if hour is 8 light LED 9 (out of 12)
	for (byte i = 0; i < 8; i++)
     {
     SoftPWMSet(leds[i], 0); // set LEDs prior to current hour LED to 0 duty cycle (out of max of 255), ie, off
     }
	for (byte i = 9; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
	SoftPWMSet(leds[8], 255); // set hour 8 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
   }
   
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == HIGH)) { // if hour is 9 light LED 10 (out of 12)
	for (byte i = 0; i < 9; i++)
     {
     SoftPWMSet(leds[i], 0); // set LEDs prior to current hour LED to 0 duty cycle (out of max of 255), ie, off
     }
	for (byte i = 10; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
	SoftPWMSet(leds[9], 255); // set hour 9 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
   }
   
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == HIGH)) { // if hour is 10 light LED 11 (out of 12)
	for (byte i = 0; i < 10; i++)
     {
     SoftPWMSet(leds[i], 0); // set LEDs prior to current hour LED to 0 duty cycle (out of max of 255), ie, off
     }
	SoftPWMSet(leds[11], 0); // set hour 11 LED to 0 duty cycle (out of max of 255), ie, off
	SoftPWMSet(leds[10], 255); // set hour 10 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
   }
   
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == HIGH)) { // if hour is 11 light LED 12 (out of 12)
	for (byte i = 0; i < 11; i++)
     {
     SoftPWMSet(leds[i], 0); // set LEDs prior to current hour LED to 0 duty cycle (out of max of 255), ie, off
     }
	SoftPWMSet(leds[11], 255); // set hour 11 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
   }

 
 
 // NUMBER 2 end.
 
}
 
 
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 


if (hour_dot == 3) { // Highlighted lit current hour LED pulses brighter in sync with change of second at quite high brightness, other LEDs dim

// NUMBER 3 start. Highlighted lit current hour LED pulses brighter in sync with change of second at quite high brightness, other LEDs dim
 
	 
//  SoftPWMSetFadeTime(ALL, 100, 450); // Sets the default fade time for LEDs attached to all above declared arduino pins as 100 ms fade-up and 450 ms to fade-down
  SoftPWMSetFadeTime(ALL, 200, 200); // Sets the default fade time for LEDs attached to all above declared arduino pins as 200 ms fade-up and 200 ms to fade-down
	 
  SoftPWMSetPolarity(ALL,SOFTPWM_INVERTED);
	 
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == LOW)) { // if hour is 0/12 light LED 1 (out of 12), ie top pink LED
	for (byte i = 1; i < 12; i++)
     {
     SoftPWMSet(leds[i], 15); // set all but current hour LEDs to 15 duty cycle (out of max of 255), ie, very dim
     }
//	SoftPWMSet(leds[0], 255); // set hour 0/12 LED to 255 duty cycle (out of max of 255), ie, full brightness	  

  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[0], 255); // Turn on hour 0/12 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-up and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
 
     SoftPWMSet(leds[0], 80); // reduce hour 0/12 LED brightness by lowering pwm setting to around 100 (out of a max of 255)
 
  // Wait for the fade-down, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
  
  to_begin = 0;  
    }
  }
   
 

 
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == LOW)) { // if hour is 1 light LED 2 (out of 12)
	SoftPWMSet(leds[0], 15); // set hour 0/12 LED to 15 duty cycle (out of max of 255), ie, very dim
	for (byte i = 2; i < 12; i++)
     {
     SoftPWMSet(leds[i], 15); // set rest of LEDs (except the current hour LED) to 15 duty cycle (out of max of 255), ie, very dim
     }
//	SoftPWMSet(leds[1], 255); // set hour 1 LED to 255 duty cycle (out of max of 255), ie, full brightness	  

  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[1], 255); // Turn on hour 1 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-up and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
 
     SoftPWMSet(leds[1], 80); // reduce hour 1 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-down, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
  
  to_begin = 0;  
    }
  }
   
 

 
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == LOW)) { // if hour is 2 light LED 3 (out of 12)
	SoftPWMSet(leds[0], 15); // set hour 0/12 LED to 15 duty cycle (out of max of 255), ie, very dim
	SoftPWMSet(leds[1], 15); // set hour 1 LED to 15 duty cycle (out of max of 255), ie, very dim
	for (byte i = 3; i < 12; i++)
     {
     SoftPWMSet(leds[i], 15); // set rest of LEDs (except the current hour LED) to 15 duty cycle (out of max of 255), ie, very dim
     }
//	SoftPWMSet(leds[2], 255); // set hour 2 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[2], 255); // Turn on hour 2 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-up and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
 
     SoftPWMSet(leds[2], 80); // reduce hour 2 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-down, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
  
  to_begin = 0;  
    }
   }
   
  

  
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == LOW)) { // if hour is 3 light LED 4 (out of 12)
	SoftPWMSet(leds[0], 15); // set hour 0/12 LED to 15 duty cycle (out of max of 255), ie, very dim
	SoftPWMSet(leds[1], 15); // set hour 1 LED to 15 duty cycle (out of max of 255), ie, very dim
	SoftPWMSet(leds[2], 15); // set hour 2 LED to 15 duty cycle (out of max of 255), ie, very dim
	for (byte i = 4; i < 12; i++)
     {
     SoftPWMSet(leds[i], 15); // set rest of LEDs (except the current hour LED) to 15 duty cycle (out of max of 255), ie, very dim
     }
//	SoftPWMSet(leds[3], 255); // set hour 3 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[3], 255); // Turn on hour 3 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-up and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
 
     SoftPWMSet(leds[3], 80); // reduce hour 3 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-down, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
  
  to_begin = 0;  
    }
   }
   
  

  
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == HIGH) && (digitalRead(BINARY_8) == LOW)) { // if hour is 4 light LED 5 (out of 12)
	for (byte i = 0; i < 4; i++)
     {
     SoftPWMSet(leds[i], 15); // set LEDs prior to current hour LED to 15 duty cycle (out of max of 255), ie, very dim
     }
	for (byte i = 5; i < 12; i++)
     {
     SoftPWMSet(leds[i], 15); // set rest of LEDs (except the current hour LED) to 15 duty cycle (out of max of 255), ie, very dim
     }
//	SoftPWMSet(leds[4], 255); // set hour 4 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[4], 255); // Turn on hour 4 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-up and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
 
     SoftPWMSet(leds[4], 80); // reduce hour 4 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-down, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
  
  to_begin = 0;  
    }
   }
   
   
   
   
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == HIGH) && (digitalRead(BINARY_8) == LOW)) { // if hour is 5 light LED 6 (out of 12)
	for (byte i = 0; i < 5; i++)
     {
     SoftPWMSet(leds[i], 15); // set LEDs prior to current hour LED to 15 duty cycle (out of max of 255), ie, very dim
     }
	for (byte i = 6; i < 12; i++)
     {
     SoftPWMSet(leds[i], 15); // set rest of LEDs (except the current hour LED) to 15 duty cycle (out of max of 255), ie, very dim
     }
//	SoftPWMSet(leds[5], 255); // set hour 5 LED to 255 duty cycle (out of max of 255), ie, full brightness	
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[5], 255); // Turn on hour 5 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-up and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
 
     SoftPWMSet(leds[5], 80); // reduce hour 5 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-down, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
  
  to_begin = 0;  
    } 
   }
   
   
   
   
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == HIGH) && (digitalRead(BINARY_8) == LOW)) { // if hour is 6 light LED 7 (out of 12)
	for (byte i = 0; i < 6; i++)
     {
     SoftPWMSet(leds[i], 15); // set LEDs prior to current hour LED to 15 duty cycle (out of max of 255), ie, very dim
     }
	for (byte i = 7; i < 12; i++)
     {
     SoftPWMSet(leds[i], 15); // set rest of LEDs (except the current hour LED) to 15 duty cycle (out of max of 255), ie, very dim
     }
//	SoftPWMSet(leds[6], 255); // set hour 6 LED to 255 duty cycle (out of max of 255), ie, full brightness	
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[6], 255); // Turn on hour 6 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-up and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
 
     SoftPWMSet(leds[6], 80); // reduce hour 6 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-down, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
  
  to_begin = 0;  
    }  
   }
   
   
   
   
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == HIGH) && (digitalRead(BINARY_8) == LOW)) { // if hour is 7 light LED 8 (out of 12)
	for (byte i = 0; i < 7; i++)
     {
     SoftPWMSet(leds[i], 15); // set LEDs prior to current hour LED to 15 duty cycle (out of max of 255), ie, very dim
     }
	for (byte i = 8; i < 12; i++)
     {
     SoftPWMSet(leds[i], 15); // set rest of LEDs (except the current hour LED) to 15 duty cycle (out of max of 255), ie, very dim
     }
//	SoftPWMSet(leds[7], 255); // set hour 7 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[7], 255); // Turn on hour 7 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-up and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
 
     SoftPWMSet(leds[7], 80); // reduce hour 7 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-down, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
  
  to_begin = 0;  
    }
   }
   
   
   
   
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == HIGH)) { // if hour is 8 light LED 9 (out of 12)
	for (byte i = 0; i < 8; i++)
     {
     SoftPWMSet(leds[i], 15); // set LEDs prior to current hour LED to 15 duty cycle (out of max of 255), ie, very dim
     }
	for (byte i = 9; i < 12; i++)
     {
     SoftPWMSet(leds[i], 15); // set rest of LEDs (except the current hour LED) to 15 duty cycle (out of max of 255), ie, very dim
     }
//	SoftPWMSet(leds[8], 255); // set hour 8 LED to 255 duty cycle (out of max of 255), ie, full brightness	 
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[8], 255); // Turn on hour 8 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-up and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
 
     SoftPWMSet(leds[8], 80); // reduce hour 8 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-down, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
  
  to_begin = 0;  
    }
   }
 

 
   
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == HIGH)) { // if hour is 9 light LED 10 (out of 12)
	for (byte i = 0; i < 9; i++)
     {
     SoftPWMSet(leds[i], 15); // set LEDs prior to current hour LED to 15 duty cycle (out of max of 255), ie, very dim
     }
	for (byte i = 10; i < 12; i++)
     {
     SoftPWMSet(leds[i], 15); // set rest of LEDs (except the current hour LED) to 15 duty cycle (out of max of 255), ie, very dim
     }
//	SoftPWMSet(leds[9], 255); // set hour 9 LED to 255 duty cycle (out of max of 255), ie, full brightness	
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[9], 255); // Turn on hour 9 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-up and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
 
     SoftPWMSet(leds[9], 80); // reduce hour 9 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-down, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
  
  to_begin = 0;  
    } 
   }
  

  
   
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == HIGH)) { // if hour is 10 light LED 11 (out of 12)
	for (byte i = 0; i < 10; i++)
     {
     SoftPWMSet(leds[i], 15); // set LEDs prior to current hour LED to 15 duty cycle (out of max of 255), ie, very dim
     }
	SoftPWMSet(leds[11], 15); // set hour 11 LED to 15 duty cycle (out of max of 255), ie, very dim
//	SoftPWMSet(leds[10], 255); // set hour 10 LED to 255 duty cycle (out of max of 255), ie, full brightness	
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[10], 255); // Turn on hour 10 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-up and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
 
     SoftPWMSet(leds[10], 80); // reduce hour 10 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-down, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
  
  to_begin = 0;  
    } 
   }
   
  

  
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == HIGH)) { // if hour is 11 light LED 12 (out of 12)
	for (byte i = 0; i < 11; i++)
     {
     SoftPWMSet(leds[i], 15); // set LEDs prior to current hour LED to 15 duty cycle (out of max of 255), ie, very dim
     }
//	SoftPWMSet(leds[11], 255); // set hour 11 LED to 255 duty cycle (out of max of 255), ie, full brightness	
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[11], 255); // Turn on hour 11 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-up and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
 
     SoftPWMSet(leds[11], 80); // reduce hour 11 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-down, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
  
  to_begin = 0;  
    }  
   }


 
// NUMBER 3 end. 

}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


if (hour_dot == 4) { // Highlighted lit current hour LED pulses brighter in sync with change of second at quite high brightness, other LEDs off

// NUMBER 4 start. Highlighted lit current hour LED pulses brighter in sync with change of second at quite high brightness, other LEDs off
 
	 
//  SoftPWMSetFadeTime(ALL, 100, 450); // Sets the default fade time for LEDs attached to all above declared arduino pins as 100 ms fade-up and 450 ms to fade-down
  SoftPWMSetFadeTime(ALL, 200, 200); // Sets the default fade time for LEDs attached to all above declared arduino pins as 200 ms fade-up and 200 ms to fade-down
	 
  SoftPWMSetPolarity(ALL,SOFTPWM_INVERTED);
	 
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == LOW)) { // if hour is 0/12 light LED 1 (out of 12), ie top pink LED
	for (byte i = 1; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set all but current hour LEDs to 0 duty cycle (out of max of 255), ie, off
     }
//	SoftPWMSet(leds[0], 255); // set hour 0/12 LED to 255 duty cycle (out of max of 255), ie, full brightness	  

  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[0], 255); // Turn on hour 0/12 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-up and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
 
     SoftPWMSet(leds[0], 80); // reduce hour 0/12 LED brightness by lowering pwm setting to around 100 (out of a max of 255)
 
  // Wait for the fade-down, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
  
  to_begin = 0;  
    }
  }
   
 

 
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == LOW)) { // if hour is 1 light LED 2 (out of 12)
	SoftPWMSet(leds[0], 0); // set hour 0/12 LED to05 duty cycle (out of max of 255), ie, off
	for (byte i = 2; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
//	SoftPWMSet(leds[1], 255); // set hour 1 LED to 255 duty cycle (out of max of 255), ie, full brightness	  

  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[1], 255); // Turn on hour 1 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-up and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
 
     SoftPWMSet(leds[1], 80); // reduce hour 1 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-down, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
  
  to_begin = 0;  
    }
  }
   
 

 
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == LOW)) { // if hour is 2 light LED 3 (out of 12)
	SoftPWMSet(leds[0], 0); // set hour 0/12 LED to 0 duty cycle (out of max of 255), ie, off
	SoftPWMSet(leds[1], 0); // set hour 1 LED to 0 duty cycle (out of max of 255), ie, off
	for (byte i = 3; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
//	SoftPWMSet(leds[2], 255); // set hour 2 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[2], 255); // Turn on hour 2 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-up and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
 
     SoftPWMSet(leds[2], 80); // reduce hour 2 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-down, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
  
  to_begin = 0;  
    }
   }
   
  

  
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == LOW)) { // if hour is 3 light LED 4 (out of 12)
	SoftPWMSet(leds[0], 0); // set hour 0/12 LED to 0 duty cycle (out of max of 255), ie, off
	SoftPWMSet(leds[1], 0); // set hour 1 LED to 0 duty cycle (out of max of 255), ie, off
	SoftPWMSet(leds[2], 0); // set hour 2 LED to 0 duty cycle (out of max of 255), ie, off
	for (byte i = 4; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
//	SoftPWMSet(leds[3], 255); // set hour 3 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[3], 255); // Turn on hour 3 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-up and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
 
     SoftPWMSet(leds[3], 80); // reduce hour 3 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-down, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
  
  to_begin = 0;  
    }
   }
   
  

  
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == HIGH) && (digitalRead(BINARY_8) == LOW)) { // if hour is 4 light LED 5 (out of 12)
	for (byte i = 0; i < 4; i++)
     {
     SoftPWMSet(leds[i], 0); // set LEDs prior to current hour LED to 0 duty cycle (out of max of 255), ie, off
     }
	for (byte i = 5; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
//	SoftPWMSet(leds[4], 255); // set hour 4 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[4], 255); // Turn on hour 4 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-up and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
 
     SoftPWMSet(leds[4], 80); // reduce hour 4 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-down, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
  
  to_begin = 0;  
    }
   }
   
   
   
   
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == HIGH) && (digitalRead(BINARY_8) == LOW)) { // if hour is 5 light LED 6 (out of 12)
	for (byte i = 0; i < 5; i++)
     {
     SoftPWMSet(leds[i], 0); // set LEDs prior to current hour LED to 0 duty cycle (out of max of 255), ie, off
     }
	for (byte i = 6; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
//	SoftPWMSet(leds[5], 255); // set hour 5 LED to 255 duty cycle (out of max of 255), ie, full brightness	
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[5], 255); // Turn on hour 5 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-up and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
 
     SoftPWMSet(leds[5], 80); // reduce hour 5 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-down, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
  
  to_begin = 0;  
    } 
   }
   
   
   
   
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == HIGH) && (digitalRead(BINARY_8) == LOW)) { // if hour is 6 light LED 7 (out of 12)
	for (byte i = 0; i < 6; i++)
     {
     SoftPWMSet(leds[i], 0); // set LEDs prior to current hour LED to 0 duty cycle (out of max of 255), ie, off
     }
	for (byte i = 7; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
//	SoftPWMSet(leds[6], 255); // set hour 6 LED to 255 duty cycle (out of max of 255), ie, full brightness	
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[6], 255); // Turn on hour 6 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-up and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
 
     SoftPWMSet(leds[6], 80); // reduce hour 6 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-down, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
  
  to_begin = 0;  
    }  
   }
   
   
   
   
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == HIGH) && (digitalRead(BINARY_8) == LOW)) { // if hour is 7 light LED 8 (out of 12)
	for (byte i = 0; i < 7; i++)
     {
     SoftPWMSet(leds[i], 0); // set LEDs prior to current hour LED to 0 duty cycle (out of max of 255), ie, off
     }
	for (byte i = 8; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
//	SoftPWMSet(leds[7], 255); // set hour 7 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[7], 255); // Turn on hour 7 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-up and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
 
     SoftPWMSet(leds[7], 80); // reduce hour 7 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-down, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
  
  to_begin = 0;  
    }
   }
   
   
   
   
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == HIGH)) { // if hour is 8 light LED 9 (out of 12)
	for (byte i = 0; i < 8; i++)
     {
     SoftPWMSet(leds[i], 0); // set LEDs prior to current hour LED to 0 duty cycle (out of max of 255), ie, off
     }
	for (byte i = 9; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
//	SoftPWMSet(leds[8], 255); // set hour 8 LED to 255 duty cycle (out of max of 255), ie, full brightness	 
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[8], 255); // Turn on hour 8 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-up and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
 
     SoftPWMSet(leds[8], 80); // reduce hour 8 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-down, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
  
  to_begin = 0;  
    }
   }
 

 
   
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == HIGH)) { // if hour is 9 light LED 10 (out of 12)
	for (byte i = 0; i < 9; i++)
     {
     SoftPWMSet(leds[i], 0); // set LEDs prior to current hour LED to 0 duty cycle (out of max of 255), ie, off
     }
	for (byte i = 10; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
//	SoftPWMSet(leds[9], 255); // set hour 9 LED to 255 duty cycle (out of max of 255), ie, full brightness	
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[9], 255); // Turn on hour 9 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-up and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
 
     SoftPWMSet(leds[9], 80); // reduce hour 9 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-down, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
  
  to_begin = 0;  
    } 
   }
  

  
   
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == HIGH)) { // if hour is 10 light LED 11 (out of 12)
	for (byte i = 0; i < 10; i++)
     {
     SoftPWMSet(leds[i], 0); // set LEDs prior to current hour LED to 0 duty cycle (out of max of 255), ie, off
     }
	SoftPWMSet(leds[11], 0); // set hour 11 LED to 0 duty cycle (out of max of 255), ie, off
//	SoftPWMSet(leds[10], 255); // set hour 10 LED to 255 duty cycle (out of max of 255), ie, full brightness	
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[10], 255); // Turn on hour 10 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-up and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
 
     SoftPWMSet(leds[10], 80); // reduce hour 10 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-down, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
  
  to_begin = 0;  
    } 
   }
   
  

  
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == HIGH)) { // if hour is 11 light LED 12 (out of 12)
	for (byte i = 0; i < 11; i++)
     {
     SoftPWMSet(leds[i], 0); // set LEDs prior to current hour LED to 0 duty cycle (out of max of 255), ie, off
     }
//	SoftPWMSet(leds[11], 255); // set hour 11 LED to 255 duty cycle (out of max of 255), ie, full brightness	
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[11], 255); // Turn on hour 11 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-up and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
 
     SoftPWMSet(leds[11], 80); // reduce hour 11 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-down, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
  
  to_begin = 0;  
    }  
   }

 
 
// NUMBER 4 end. 

}


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if (hour_dot == 5) { // Highlighted lit current hour LED pulses dimmer in sync with change of second at quite high brightness, other LEDs dim

// NUMBER 5 start. Highlighted lit current hour LED pulses dimmer in sync with change of second at quite high brightness, other LEDs dim
 
	 
//  SoftPWMSetFadeTime(ALL, 100, 450); // Sets the default fade time for LEDs attached to all above declared arduino pins as 100 ms fade-up and 450 ms to fade-down
  SoftPWMSetFadeTime(ALL, 200, 200); // Sets the default fade time for LEDs attached to all above declared arduino pins as 200 ms fade-up and 200 ms to fade-down
	 
  SoftPWMSetPolarity(ALL,SOFTPWM_INVERTED);
	 
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == LOW)) { // if hour is 0/12 light LED 1 (out of 12), ie top pink LED
	for (byte i = 1; i < 12; i++)
     {
     SoftPWMSet(leds[i], 15); // set all but current hour LEDs to 15 duty cycle (out of max of 255), ie, very dim
     }
//	SoftPWMSet(leds[0], 255); // set hour 0/12 LED to 255 duty cycle (out of max of 255), ie, full brightness	  

  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[0], 80); // Turn on hour 0/12 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-down and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
 
     SoftPWMSet(leds[0], 255); // reduce hour 0/12 LED brightness by lowering pwm setting to around 100 (out of a max of 255)
 
  // Wait for the fade-up, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
  
  to_begin = 0;  
    }
  }
   
 

 
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == LOW)) { // if hour is 1 light LED 2 (out of 12)
	SoftPWMSet(leds[0], 15); // set hour 0/12 LED to 15 duty cycle (out of max of 255), ie, very dim
	for (byte i = 2; i < 12; i++)
     {
     SoftPWMSet(leds[i], 15); // set rest of LEDs (except the current hour LED) to 15 duty cycle (out of max of 255), ie, very dim
     }
//	SoftPWMSet(leds[1], 255); // set hour 1 LED to 255 duty cycle (out of max of 255), ie, full brightness	  

  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[1], 80); // Turn on hour 1 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-down and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
 
     SoftPWMSet(leds[1], 255); // reduce hour 1 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-up, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
  
  to_begin = 0;  
    }
  }
   
 

 
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == LOW)) { // if hour is 2 light LED 3 (out of 12)
	SoftPWMSet(leds[0], 15); // set hour 0/12 LED to 15 duty cycle (out of max of 255), ie, very dim
	SoftPWMSet(leds[1], 15); // set hour 1 LED to 15 duty cycle (out of max of 255), ie, very dim
	for (byte i = 3; i < 12; i++)
     {
     SoftPWMSet(leds[i], 15); // set rest of LEDs (except the current hour LED) to 15 duty cycle (out of max of 255), ie, very dim
     }
//	SoftPWMSet(leds[2], 255); // set hour 2 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[2], 80); // Turn on hour 2 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-down and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
 
     SoftPWMSet(leds[2], 255); // reduce hour 2 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-up, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
  
  to_begin = 0;  
    }
   }
   
  

  
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == LOW)) { // if hour is 3 light LED 4 (out of 12)
	SoftPWMSet(leds[0], 15); // set hour 0/12 LED to 15 duty cycle (out of max of 255), ie, very dim
	SoftPWMSet(leds[1], 15); // set hour 1 LED to 15 duty cycle (out of max of 255), ie, very dim
	SoftPWMSet(leds[2], 15); // set hour 2 LED to 15 duty cycle (out of max of 255), ie, very dim
	for (byte i = 4; i < 12; i++)
     {
     SoftPWMSet(leds[i], 15); // set rest of LEDs (except the current hour LED) to 15 duty cycle (out of max of 255), ie, very dim
     }
//	SoftPWMSet(leds[3], 255); // set hour 3 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[3], 80); // Turn on hour 3 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-down and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
 
     SoftPWMSet(leds[3], 255); // reduce hour 3 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-up, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
  
  to_begin = 0;  
    }
   }
   
  

  
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == HIGH) && (digitalRead(BINARY_8) == LOW)) { // if hour is 4 light LED 5 (out of 12)
	for (byte i = 0; i < 4; i++)
     {
     SoftPWMSet(leds[i], 15); // set LEDs prior to current hour LED to 15 duty cycle (out of max of 255), ie, very dim
     }
	for (byte i = 5; i < 12; i++)
     {
     SoftPWMSet(leds[i], 15); // set rest of LEDs (except the current hour LED) to 15 duty cycle (out of max of 255), ie, very dim
     }
//	SoftPWMSet(leds[4], 255); // set hour 4 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[4], 80); // Turn on hour 4 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-down and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
 
     SoftPWMSet(leds[4], 255); // reduce hour 4 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-up, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
  
  to_begin = 0;  
    }
   }
   
   
   
   
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == HIGH) && (digitalRead(BINARY_8) == LOW)) { // if hour is 5 light LED 6 (out of 12)
	for (byte i = 0; i < 5; i++)
     {
     SoftPWMSet(leds[i], 15); // set LEDs prior to current hour LED to 15 duty cycle (out of max of 255), ie, very dim
     }
	for (byte i = 6; i < 12; i++)
     {
     SoftPWMSet(leds[i], 15); // set rest of LEDs (except the current hour LED) to 15 duty cycle (out of max of 255), ie, very dim
     }
//	SoftPWMSet(leds[5], 255); // set hour 5 LED to 255 duty cycle (out of max of 255), ie, full brightness	
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[5], 80); // Turn on hour 5 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-down and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
 
     SoftPWMSet(leds[5], 255); // reduce hour 5 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-up, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
  
  to_begin = 0;  
    } 
   }
   
   
   
   
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == HIGH) && (digitalRead(BINARY_8) == LOW)) { // if hour is 6 light LED 7 (out of 12)
	for (byte i = 0; i < 6; i++)
     {
     SoftPWMSet(leds[i], 15); // set LEDs prior to current hour LED to 15 duty cycle (out of max of 255), ie, very dim
     }
	for (byte i = 7; i < 12; i++)
     {
     SoftPWMSet(leds[i], 15); // set rest of LEDs (except the current hour LED) to 15 duty cycle (out of max of 255), ie, very dim
     }
//	SoftPWMSet(leds[6], 255); // set hour 6 LED to 255 duty cycle (out of max of 255), ie, full brightness	
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[6], 80); // Turn on hour 6 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-down and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
 
     SoftPWMSet(leds[6], 255); // reduce hour 6 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-up, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
  
  to_begin = 0;  
    }  
   }
   
   
   
   
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == HIGH) && (digitalRead(BINARY_8) == LOW)) { // if hour is 7 light LED 8 (out of 12)
	for (byte i = 0; i < 7; i++)
     {
     SoftPWMSet(leds[i], 15); // set LEDs prior to current hour LED to 15 duty cycle (out of max of 255), ie, very dim
     }
	for (byte i = 8; i < 12; i++)
     {
     SoftPWMSet(leds[i], 15); // set rest of LEDs (except the current hour LED) to 15 duty cycle (out of max of 255), ie, very dim
     }
//	SoftPWMSet(leds[7], 255); // set hour 7 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[7], 80); // Turn on hour 7 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-down and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
 
     SoftPWMSet(leds[7], 255); // reduce hour 7 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-up, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
  
  to_begin = 0;  
    }
   }
   
   
   
   
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == HIGH)) { // if hour is 8 light LED 9 (out of 12)
	for (byte i = 0; i < 8; i++)
     {
     SoftPWMSet(leds[i], 15); // set LEDs prior to current hour LED to 15 duty cycle (out of max of 255), ie, very dim
     }
	for (byte i = 9; i < 12; i++)
     {
     SoftPWMSet(leds[i], 15); // set rest of LEDs (except the current hour LED) to 15 duty cycle (out of max of 255), ie, very dim
     }
//	SoftPWMSet(leds[8], 255); // set hour 8 LED to 255 duty cycle (out of max of 255), ie, full brightness	 
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[8], 80); // Turn on hour 8 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-down and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
 
     SoftPWMSet(leds[8], 255); // reduce hour 8 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-up, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
  
  to_begin = 0;  
    }
   }
 

 
   
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == HIGH)) { // if hour is 9 light LED 10 (out of 12)
	for (byte i = 0; i < 9; i++)
     {
     SoftPWMSet(leds[i], 15); // set LEDs prior to current hour LED to 15 duty cycle (out of max of 255), ie, very dim
     }
	for (byte i = 10; i < 12; i++)
     {
     SoftPWMSet(leds[i], 15); // set rest of LEDs (except the current hour LED) to 15 duty cycle (out of max of 255), ie, very dim
     }
//	SoftPWMSet(leds[9], 255); // set hour 9 LED to 255 duty cycle (out of max of 255), ie, full brightness	
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[9], 80); // Turn on hour 9 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-down and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
 
     SoftPWMSet(leds[9], 255); // reduce hour 9 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-up, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
  
  to_begin = 0;  
    } 
   }
  

  
   
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == HIGH)) { // if hour is 10 light LED 11 (out of 12)
	for (byte i = 0; i < 10; i++)
     {
     SoftPWMSet(leds[i], 15); // set LEDs prior to current hour LED to 15 duty cycle (out of max of 255), ie, very dim
     }
	SoftPWMSet(leds[11], 15); // set hour 11 LED to 15 duty cycle (out of max of 255), ie, very dim
//	SoftPWMSet(leds[10], 255); // set hour 10 LED to 255 duty cycle (out of max of 255), ie, full brightness	
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[10], 80); // Turn on hour 10 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-down and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
 
     SoftPWMSet(leds[10], 255); // reduce hour 10 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-up, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
  
  to_begin = 0;  
    } 
   }
   
  

  
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == HIGH)) { // if hour is 11 light LED 12 (out of 12)
	for (byte i = 0; i < 11; i++)
     {
     SoftPWMSet(leds[i], 15); // set LEDs prior to current hour LED to 15 duty cycle (out of max of 255), ie, very dim
     }
//	SoftPWMSet(leds[11], 255); // set hour 11 LED to 255 duty cycle (out of max of 255), ie, full brightness	
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[11], 80); // Turn on hour 11 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-down and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
 
     SoftPWMSet(leds[11], 255); // reduce hour 11 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-up, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
  
  to_begin = 0;  
    }  
   }


 
// NUMBER 5 end. 

}


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if (hour_dot == 6) { // Highlighted lit current hour LED pulses dimmer in sync with change of second at quite high brightness, other LEDs off

// NUMBER 6 start. Highlighted lit current hour LED pulses dimmer in sync with change of second at quite high brightness, other LEDs off
 
	 
//  SoftPWMSetFadeTime(ALL, 100, 450); // Sets the default fade time for LEDs attached to all above declared arduino pins as 100 ms fade-up and 450 ms to fade-down
  SoftPWMSetFadeTime(ALL, 200, 200); // Sets the default fade time for LEDs attached to all above declared arduino pins as 200 ms fade-up and 200 ms to fade-down
	 
  SoftPWMSetPolarity(ALL,SOFTPWM_INVERTED);
	 
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == LOW)) { // if hour is 0/12 light LED 1 (out of 12), ie top pink LED
	for (byte i = 1; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set all but current hour LEDs to 0 duty cycle (out of max of 255), ie, off
     }
//	SoftPWMSet(leds[0], 255); // set hour 0/12 LED to 255 duty cycle (out of max of 255), ie, full brightness	  

  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[0], 80); // Turn on hour 0/12 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-down and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
 
     SoftPWMSet(leds[0], 255); // reduce hour 0/12 LED brightness by lowering pwm setting to around 100 (out of a max of 255)
 
  // Wait for the fade-up, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
  
  to_begin = 0;  
    }
  }
   
 

 
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == LOW)) { // if hour is 1 light LED 2 (out of 12)
	SoftPWMSet(leds[0], 0); // set hour 0/12 LED to 0 duty cycle (out of max of 255), ie, off
	for (byte i = 2; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
//	SoftPWMSet(leds[1], 255); // set hour 1 LED to 255 duty cycle (out of max of 255), ie, full brightness	  

  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[1], 80); // Turn on hour 1 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-down and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
 
     SoftPWMSet(leds[1], 255); // reduce hour 1 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-up, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
  
  to_begin = 0;  
    }
  }
   
 

 
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == LOW)) { // if hour is 2 light LED 3 (out of 12)
	SoftPWMSet(leds[0], 0); // set hour 0/12 LED to 0 duty cycle (out of max of 255), ie, off
	SoftPWMSet(leds[1], 0); // set hour 1 LED to 0 duty cycle (out of max of 255), ie, off
	for (byte i = 3; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
//	SoftPWMSet(leds[2], 255); // set hour 2 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[2], 80); // Turn on hour 2 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-down and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
 
     SoftPWMSet(leds[2], 255); // reduce hour 2 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-up, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
  
  to_begin = 0;  
    }
   }
   
  

  
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == LOW)) { // if hour is 3 light LED 4 (out of 12)
	SoftPWMSet(leds[0], 0); // set hour 0/12 LED to 0 duty cycle (out of max of 255), ie, off
	SoftPWMSet(leds[1], 0); // set hour 1 LED to 0 duty cycle (out of max of 255), ie, off
	SoftPWMSet(leds[2], 0); // set hour 2 LED to 0 duty cycle (out of max of 255), ie, off
	for (byte i = 4; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
//	SoftPWMSet(leds[3], 255); // set hour 3 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[3], 80); // Turn on hour 3 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-down and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
 
     SoftPWMSet(leds[3], 255); // reduce hour 3 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-up, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
  
  to_begin = 0;  
    }
   }
   
  

  
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == HIGH) && (digitalRead(BINARY_8) == LOW)) { // if hour is 4 light LED 5 (out of 12)
	for (byte i = 0; i < 4; i++)
     {
     SoftPWMSet(leds[i], 0); // set LEDs prior to current hour LED to 0 duty cycle (out of max of 255), ie, off
     }
	for (byte i = 5; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
//	SoftPWMSet(leds[4], 255); // set hour 4 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[4], 80); // Turn on hour 4 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-down and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
 
     SoftPWMSet(leds[4], 255); // reduce hour 4 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-up, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
  
  to_begin = 0;  
    }
   }
   
   
   
   
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == HIGH) && (digitalRead(BINARY_8) == LOW)) { // if hour is 5 light LED 6 (out of 12)
	for (byte i = 0; i < 5; i++)
     {
     SoftPWMSet(leds[i], 0); // set LEDs prior to current hour LED to 0 duty cycle (out of max of 255), ie, off
	for (byte i = 6; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
//	SoftPWMSet(leds[5], 255); // set hour 5 LED to 255 duty cycle (out of max of 255), ie, full brightness	
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[5], 80); // Turn on hour 5 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
	}
  // Wait for the fade-down and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
 
     SoftPWMSet(leds[5], 255); // reduce hour 5 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-up, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
  
  to_begin = 0;  
    } 
   }
   
   
   
   
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == HIGH) && (digitalRead(BINARY_8) == LOW)) { // if hour is 6 light LED 7 (out of 12)
	for (byte i = 0; i < 6; i++)
     {
     SoftPWMSet(leds[i], 0); // set LEDs prior to current hour LED to 0 duty cycle (out of max of 255), ie, off
     }
	for (byte i = 7; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
//	SoftPWMSet(leds[6], 255); // set hour 6 LED to 255 duty cycle (out of max of 255), ie, full brightness	
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[6], 80); // Turn on hour 6 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-down and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
 
     SoftPWMSet(leds[6], 255); // reduce hour 6 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-up, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
  
  to_begin = 0;  
    }  
   }
   
   
   
   
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == HIGH) && (digitalRead(BINARY_8) == LOW)) { // if hour is 7 light LED 8 (out of 12)
	for (byte i = 0; i < 7; i++)
     {
     SoftPWMSet(leds[i], 0); // set LEDs prior to current hour LED to 0 duty cycle (out of max of 255), ie, off
     }
	for (byte i = 8; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
//	SoftPWMSet(leds[7], 255); // set hour 7 LED to 255 duty cycle (out of max of 255), ie, full brightness	  
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[7], 80); // Turn on hour 7 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-down and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
 
     SoftPWMSet(leds[7], 255); // reduce hour 7 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-up, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
  
  to_begin = 0;  
    }
   }
   
   
   
   
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == HIGH)) { // if hour is 8 light LED 9 (out of 12)
	for (byte i = 0; i < 8; i++)
     {
     SoftPWMSet(leds[i], 0); // set LEDs prior to current hour LED to 0 duty cycle (out of max of 255), ie, off
     }
	for (byte i = 9; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
//	SoftPWMSet(leds[8], 255); // set hour 8 LED to 255 duty cycle (out of max of 255), ie, full brightness	 
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[8], 80); // Turn on hour 8 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-down and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
 
     SoftPWMSet(leds[8], 255); // reduce hour 8 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-up, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
  
  to_begin = 0;  
    }
   }
 

 
   
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == LOW) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == HIGH)) { // if hour is 9 light LED 10 (out of 12)
	for (byte i = 0; i < 9; i++)
     {
     SoftPWMSet(leds[i], 0); // set LEDs prior to current hour LED to 0 duty cycle (out of max of 255), ie, off
     }
	for (byte i = 10; i < 12; i++)
     {
     SoftPWMSet(leds[i], 0); // set rest of LEDs (except the current hour LED) to 0 duty cycle (out of max of 255), ie, off
     }
//	SoftPWMSet(leds[9], 255); // set hour 9 LED to 255 duty cycle (out of max of 255), ie, full brightness	
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[9], 80); // Turn on hour 9 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-down and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
 
     SoftPWMSet(leds[9], 255); // reduce hour 9 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-up, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
  
  to_begin = 0;  
    } 
   }
  

  
   
  if ((digitalRead(BINARY_1) == LOW) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == HIGH)) { // if hour is 10 light LED 11 (out of 12)
	for (byte i = 0; i < 10; i++)
     {
     SoftPWMSet(leds[i], 0); // set LEDs prior to current hour LED to 0 duty cycle (out of max of 255), ie, off
     }
	SoftPWMSet(leds[11], 0); // set hour 11 LED to 0 duty cycle (out of max of 255), ie, off
//	SoftPWMSet(leds[10], 255); // set hour 10 LED to 255 duty cycle (out of max of 255), ie, full brightness	
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[10], 80); // Turn on hour 10 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-down and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
 
     SoftPWMSet(leds[10], 255); // reduce hour 10 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-up, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
  
  to_begin = 0;  
    } 
   }
   
  

  
  if ((digitalRead(BINARY_1) == HIGH) && (digitalRead(BINARY_2) == HIGH) && (digitalRead(BINARY_4) == LOW) && (digitalRead(BINARY_8) == HIGH)) { // if hour is 11 light LED 12 (out of 12)
	for (byte i = 0; i < 11; i++)
     {
     SoftPWMSet(leds[i], 0); // set LEDs prior to current hour LED to 0 duty cycle (out of max of 255), ie, off
     }
//	SoftPWMSet(leds[11], 255); // set hour 11 LED to 255 duty cycle (out of max of 255), ie, full brightness	
  if (to_begin == 1)
    {	  
     SoftPWMSet(leds[11], 80); // Turn on hour 11 LED to max brightness by setting pwm setting to 255 (out of a max of 255)
 
  // Wait for the fade-down and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-down time, otherwise the fade-down transition will be cut short
 
     SoftPWMSet(leds[11], 255); // reduce hour 11 LED brightness by lowering pwm setting to around 80 (out of a max of 255)
 
  // Wait for the fade-up, and some extra delay.
  delay(210); // needs to be greater than or equal to the fade-up time, otherwise the fade-up transition will be cut short
  
  to_begin = 0;  
    }  
   }


 
// NUMBER 6 end. 

  }
  
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  
 
 } // end of ' if (digitalRead(DOT_CLOCK) == LOW)'
 
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
 
} // end of 'void(loop)'
 

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
 
 
 
 void Increment_PINK_RING ()
 {
		PINK_RING_ANIMATION = PINK_RING_ANIMATION + 1;
		if (PINK_RING_ANIMATION == 11) PINK_RING_ANIMATION = 0;
		PINK_MODE_CHANGED = true; // 
		CHASER_JUST_CHANGED = true;

 }
