Need help debugging my Binary Clock I have tried everything but I can't get my binary clock to display correctly. The diagram and code are here: Binary Clock | Electronics Lab.

The hardware is based off this (it also explains the process that my program is trying to do): DIY: Binary Clock with Arduino. The problems lie in a, probably, simple error as my variable tempTime, which is used to convert the individual digits to their binary equivalent, does not change when I tell it to. All this occurs in the display function. (Sorry, I'm new Here and only a high school student)

While debugging it I realized that the only problem is the variable tempTime - the hardware and other functions work as they were intended. 
Can anyone help? (Sorry if this is not very well documented).

    int digitPins[4][4] = {{13,6,-1,-1},{12,7,3,1},{11,8,4,-1},{10,9,5,2}};
int time[4] = {0,0,0,0};
int steps[4]={1,2,4,8};
int tempTime = 0;
void setup(){
  for(int x = 0; x &lt; 4; x++){
    for(int y =0; y&lt;4; y++){
    pinMode(digitPins[x][y],OUTPUT);
    }
  }
    Serial.begin(9600);
    convertHour(12);
    convertMinute(57);
    Serial.println("The time is:");

  for(int z = 0; z &lt; 4; z++){
    if(z == 2){
    Serial.print(":");
    }
  Serial.print(time[z]);
  }
  display();
}
void loop(){

}
void display(){
  int displayer[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
/*
0 - Hour
1 - Hour
2 - Minute
3 - Minute
4 - Hour(Total)
5 - Minute(Total)
*/

  int counter1 = 0;
  for(int i = 0; i &lt; 4; i++){ //Loop for the individual digits
    tempTime = time[i];
    if(tempTime &gt;= 10){
    tempTime = tempTime % 10;
    }
    Serial.print("\nBegining new iteration i = ");
    Serial.print("\nStarting with digit: ");
    Serial.print(tempTime);
    Serial.print(i);
    Serial.println("");
    for(int j = 3; j &gt;= 0; j--){//Loop to determin the arrangement
      if(time[i]/steps[j] &gt;= 1 &amp;&amp; steps[j] &gt; 0 &amp;&amp; digitPins[i][j] &gt; 0){
        Serial.print("\n");
        Serial.print(time[i]);
        Serial.print("/");
        Serial.print(steps[j]);
        Serial.print(" = ");
        Serial.print(time[i]/steps[j]);
        tempTime =tempTime - (time[i]*steps[j]);
        displayer[counter1] = digitPins[i][j];
        Serial.print("\nAdded: ");
        Serial.print(digitPins[i][j]);
        counter1++;
      }
    }

  }
  clear();
  for(int a = 0; a &lt; 13; a++){
  digitalWrite(displayer[a],HIGH);
  }
}
void clear(){
  for(int x = 0; x &lt; 4; x++){
    for(int y =0; y&lt;4; y++){
    digitalWrite(digitPins[x][y],LOW);
    }
  }
}
  void convertHour(int value){
    int digits[] = {0,0};
    if(value &gt;= 10){
        debug("Bigger than 10");
        if(value &gt;= 20){
            digits[0] = 2;  
        }else{
            digits[0] = 1;
        }
    }
    digits[1] = value - (digits[0] * 10);
    //String hour = digits[0]+""+digits[1];
    //Serial.print(digits[0]);
    //Serial.print(digits[1]);
    time[0] = digits[0];
    time[1] = digits[1];
  }
void convertMinute(int value){
  int digits[2] = {0,0};
  int val = value;
  if(value &gt;= 10){
    digits[0] = val/10;
  }
  digits[1] = value - (digits[0] * 10);
  Serial.print("\n");
  Serial.print(digits[0]);
  Serial.print(digits[1]);
  time[2] = digits[0];
  time[3] = digits[1];
}
  void debug(String value){
    boolean de = true;
    if(de){
    Serial.println(value);
    }
  }
In your “Loop to determin the arrangement”, you are erroneously using
time[i] in several places where you mean tempTime. Also, to update
tempTime you only have to subtract steps[j]. With these fixes, your
loop becomes:

for(int j = 3; j &gt;= 0; j--){//Loop to determin the arrangement
  if(tempTime/steps[j] &gt;= 1 &amp;&amp; steps[j] &gt; 0 &amp;&amp; digitPins[i][j] &gt; 0){
    Serial.print("\n");
    Serial.print(tempTime);
    Serial.print("/");
    Serial.print(steps[j]);
    Serial.print(" = ");
    Serial.print(tempTime/steps[j]);
    tempTime = tempTime - steps[j];
    displayer[counter1] = digitPins[i][j];
    Serial.print("\r\nAdded: ");
    Serial.print(digitPins[i][j]);
    counter1++;
  }
}


Now, if you learn a little bit about how binary numbers work, and about
the binary operators in C and C++, you can rewrite your loop in a
simpler form:

for (int j = 3; j &gt;= 0; j--) {
  int weight = 1 &lt;&lt; j;      // 2 raised to the power j
  if (tempTime &amp; weight) {  // if bit j of tempTime is set
    displayer[counter1++] = digitPins[i][j];
    Serial.print("Added bit ");
    Serial.print(j);
    Serial.print(", weight ");
    Serial.print(weight);
    Serial.print(", output ");
    Serial.println(digitPins[i][j]);
  }
}


As a side note, it is considered good practice to print a new line at
the end of each string you print (using println()), rather than at
the beginning.

Edit: As your display() function is way too complex for what it
does, I did not resist the temptation to simplify it:

void display() {
  for (int i = 0; i &lt; 4; i++)
    for (int j = 0; j &lt; 4 &amp;&amp; digitPins[i][j] &gt;= 0; j++)
      digitalWrite(digitPins[i][j], time[i] &amp; (1&lt;&lt;j));
}