#include <Arduino.h>
#define data PB2 // Arduino pin for data pin of the shift register
#define latch PB1 // Arduino pin for latch pin of the shift register
#define clock PB0 // Arduino pin for clock pin of the shift register
#define dig1 5
#define dig2 6
#define dig3 7
#define dig4 8
#define common 'c'
#include "7seg.h"
void setup() {
//for (byte i=2; i < 9; i++)pinMode(i,OUTPUT);
//for (byte i=5; i < 9; i++)digitalWrite(i,1);//dig1 - dig4 is being set to high to pervent 7seg from unexpected acting
pinMode(PB0,OUTPUT);
pinMode(PB1,OUTPUT);
pinMode(PB2,OUTPUT);
pinMode(PB3,OUTPUT);
}
void loop() {
static uint32_t tmr;
// static byte a[3];
// static bool start;
static int curt;
// if (!start){
// char str[] = __TIME__;
// byte count;
// char *tok = strtok(str, ":");
// while (tok != NULL)
// {
// a[count++] = atoi(tok);
// tok = strtok(NULL, ":");
// }
// a[2]++;
// start = 1;
// }
// if (millis()-tmr>1000){
// a[2]+=(millis() - tmr)/999;
// tmr = millis();
// if (a[2] > 59){a[1]+=1;a[2] = 0;}
// if (a[1]> 59){a[0]+=1;a[1] = 0;}
// if (a[0] > 24){a[0] = 0;}
// curt = a[0]*100+a[1];
// Serial.print(a[0]);
// Serial.print(';');
// Serial.print(a[1]);
// Serial.print(';');
// Serial.println(a[2]);
// }
if (millis()-tmr>1000){
tmr = millis();
curt++;}
update(curt,0);
}