help me adding button to my project

hi i am intersted in a project that shows time in binary-decimal way using arduino and ds1302 module and also neopixels this project is perfect the only downside is that i cant add minutes and hours manualy and i should set it via computer i think it will be more convenient if we add two button which by pressing each of them it adds on value to hour and minute i think 2 button are enough and just adding by pressing them is enough too, we don’t need to decrease values and also it is not necessary to set seconds so help me to add the code line,
the file is attached download it if you want to help me .
thanx

BinaryClock_Final.ino (5.23 KB)

Or, you could just POST THE CODE

#include <virtuabotixRTC.h>
#include <Adafruit_NeoPixel.h>

// Creation of the Real Time Clock Object
// SCLK(CLK) -> 6, I/O(DAT) -> 7, CE(RST) -> 8
virtuabotixRTC myRTC(6, 7, 8);

#define NUMPIXELS 24
#define PIN 5


Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

int hourLEDs[4] = {4,10,16,22};
int hourTensLEDs[2] = {5,11};
int minuteLEDs[4] = {2,8,14,20};
int minuteTensLEDs[3] = {3,9,15};
int secondLEDs[4] = {0, 6, 12, 18};
int secondsTensLEDs[3] = {1, 7, 13};

char buffer[9] ="";

int secs, mins, hrs;
int sunit, munit, hunit;
int sten, mten, hten;

int sunittemp, stentemp, munittemp,mtentemp, hunittemp, htentemp;

int sunitArray[10][3]{
  {24,24,24},
  {0,24,24},
  {6,24,24},
  {0,6,24},
  {12,24,24},
  {0,12,24},
  {6,12,24},
  {0,6,12},
  {18,24,24},
  {0,18,24}
  };

int stenArray[10][3]{
  {24,24,24},
  {1,24,24},
  {7,24,24},
  {1,7,24},
  {13,24,24},
  {1,13,24},
  {7,13,24},
  {1,7,13},
  {19,24,24},
  (1,19,24)
  };

int munitArray[10][3]{
  {24,24,24},
  {2,24,24},
  {8,24,24},
  {2,8,24},
  {14,24,24},
  {2,14,24},
  {8,14,24},
  {2,8,14},
  {20,24,24},
  {2,20,24}
  };

int mtenArray[10][3]{
  {24,24,24},
  {3,24,24},
  {9,24,24},
  {3,9,24},
  {15,24,24},
  {3,15,24},
  {9,15,24},
  {3,9,15},
  {21,24,24},
  {3,21,24}
  };

int hunitArray[10][3]{
  {24,24,24},
  {4,24,24},
  {10,24,24},
  {4,10,24},
  {16,24,24},
  {4,16,24},
  {10,16,24},
  {4,10,16},
  {22,24,24},
  {4,22,24}
  };
  
int htenArray[10][3]{
  {24,24,24},
  {5,24,24},
  {11,24,24},
  {5,11,24},
  {17,24,24},
  {5,17,24},
  {11,17,24},
  {5,11,17},
  {23,24,24},
  {5,23,24}
  };
  
const int analogInPin = A0;
int sensorValue = 0;
int outputValue =0;
  
void setup()
{
  

// seconds, minutes, hours, day of the week, day of the month, month, year  
// NOTE ...  Use this for the inital time setting, once uploaded, comment the line below out and upload again
// this prevent the time restting each time you restart the Arduino.

// myRTC.setDS1302Time(00, 28, 17, 7, 27, 3, 2016);

  pixels.begin();
  pixels.setBrightness(125);
  pixels.show();
  int secs = myRTC.seconds;
  
  int sunittemp = secs % 10;
  int stentemp = secs / 10;
  
  int munittemp = mins % 10;
  int mtentemp = mins / 10;
  
  int hunittemp = hrs % 10;
  int htentemp = hrs / 10;
  
}

    
void loop(){

sensorValue = analogRead(analogInPin);  
outputValue = map(sensorValue, 915, 1023, 75, 255);
pixels.setBrightness(outputValue);
pixels.show();
  
myRTC.updateTime();


secs = myRTC.seconds;
mins = myRTC.minutes;
hrs = myRTC.hours;  
  
sunit = secs % 10;
munit = mins % 10;
hunit = hrs % 10;

sten = secs / 10;
mten = mins / 10;
hten = hrs / 10;


if (sunit != sunittemp)
{
 // Seconds Unit Itterator 
 clearSecondUnits();
  
 for (int i = 0; i < 3; i++)
 {
    pixels.setPixelColor(sunitArray[sunit][i], pixels.Color(255,0,0));
    pixels.show();
  }
 sunittemp = sunit;
} 

if (sten != stentemp)
{
  if (sten >= 1 || sten == 0)
  {
   clearSecondTens();
    for (int i = 0; i < 3; i++)
    {
      pixels.setPixelColor(stenArray[sten][i], pixels.Color(255,0,0));
      pixels.show();
    }
  }
stentemp = sten;
}


////   Minutes

// units
if (munit != munittemp)
{
  clearMinuteUnits();
for (int i = 0; i < 3; i++)
    {
      pixels.setPixelColor(munitArray[munit][i], pixels.Color(0,255,0));
      pixels.show();
    }
munittemp = munit;    
}

// tens 
if (mten != mtentemp)
{
  clearMinuteTens();
  for (int i = 0; i < 3; i++)
  {
    pixels.setPixelColor(mtenArray[mten][i], pixels.Color(0,255,0));
    pixels.show();
    // Serial.println(mins);
  }
 mtentemp = mten;
}


///  HOURS


// units
if (hunit != hunittemp)
{
  clearHourUnits();
for (int i = 0; i < 3; i++)
    {
      pixels.setPixelColor(hunitArray[hunit][i], pixels.Color(0,0,255));
      pixels.show();
    }
hunittemp = hunit;    
}

// tens 
if (hten != htentemp)
{
  clearHourTens();
  for (int i = 0; i < 3; i++)
  {
    pixels.setPixelColor(htenArray[hten][i], pixels.Color(0,0,255));
    pixels.show();
    // Serial.println(mins);
  }
 htentemp = hten;
}



///  End loop
}



void clearSecondUnits()
{
  for (int i = 0; i < (sizeof(secondLEDs) / sizeof(secondLEDs[0])); i++)
  {
    // Serial.println(i);
    pixels.setPixelColor(secondLEDs[i], 0);
  }
}

void clearSecondTens()
{
  for (int i = 0; i < (sizeof(secondsTensLEDs) / sizeof(secondsTensLEDs[0])); i++)
  {
    pixels.setPixelColor(secondsTensLEDs[i], 0);
  }
}

void clearMinuteUnits()
{
  for (int i = 0; i < (sizeof(minuteLEDs) / sizeof(minuteLEDs[0])); i++)
  {
    pixels.setPixelColor(minuteLEDs[i], 0);
  }
}

void clearMinuteTens()
{
  for (int i = 0; i < (sizeof(minuteTensLEDs) / sizeof(minuteTensLEDs[0])); i++)
  {
    pixels.setPixelColor(minuteTensLEDs[i], 0);
  }
}


void clearHourUnits()
{
  for (int i = 0; i < (sizeof(hourLEDs) / sizeof(hourLEDs[0])); i++)
  {
    pixels.setPixelColor(hourLEDs[i], 0);
  }
}

void clearHourTens()
{
  for (int i = 0; i < (sizeof(hourTensLEDs) / sizeof(hourTensLEDs[0])); i++)
  {
    pixels.setPixelColor(hourTensLEDs[i], 0);
  }
}
int sunitArray[10][3]{

Terrible waste of precious RAM.

AWOL:

int sunitArray[10][3]{

Terrible waste of precious RAM.

excuse me i dont get what you mean by this one ? ram?

RAM == Random Access Memory.
You don't have very much of it, so using variables which are twice as big as they need to be is a waste.
Using it for values that don't change is even more pointless - keep them in PROGMEM, where they belong.

AWOL:
RAM == Random Access Memory.
You don't have very much of it, so using variables which are twice as big as they need to be is a waste.
Using it for values that don't change is even more pointless - keep them in PROGMEM, where they belong.

i appreciate it but my problem was something else , i need to add switches other things are for later!

I'm pretty sure there are switch examples provided in the IDE.