void
clock
() {
int
H=10, M=36, S=0, AM=0, blink=0;
int8_t
offset=0;
ledarray_blank();
while
(1){
ledarray_blank();
offset=0;
if
(H==0){
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
}
else
if
(H==1){
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
font_display(
'1'
, offset); offset += font_width(
'1'
)+1; delay_ms(0);
}
else
if
(H==2){
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
font_display(
'2'
, offset); offset += font_width(
'2'
)+1; delay_ms(0);
}
else
if
(H==3){
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
font_display(
'3'
, offset); offset += font_width(
'3'
)+1; delay_ms(0);
}
else
if
(H==4){
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
font_display(
'4'
, offset); offset += font_width(
'4'
)+1; delay_ms(0);
}
else
if
(H==5){
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
font_display(
'5'
, offset); offset += font_width(
'5'
)+1; delay_ms(0);
}
else
if
(H==6){
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
font_display(
'6'
, offset); offset += font_width(
'6'
)+1; delay_ms(0);
}
else
if
(H==7){
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
font_display(
'7'
, offset); offset += font_width(
'7'
)+1; delay_ms(0);
}
else
if
(H==8){
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
font_display(
'8'
, offset); offset += font_width(
'8'
)+1; delay_ms(0);
}
else
if
(H==9){
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
font_display(
'9'
, offset); offset += font_width(
'9'
)+1; delay_ms(0);
}
else
if
(H==10){
font_display(
'1'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
font_display(
'0'
, offset); offset += font_width(
'1'
)+1; delay_ms(0);
}
else
if
(H==11){
font_display(
'1'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
font_display(
'1'
, offset); offset += font_width(
'1'
)+1; delay_ms(0);
}
else
if
(H==12){
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
H=0;
if
(AM=0){
AM++;
}
else
{
AM=0;
}
}
if
(blink==0){
font_display(
':'
, offset); offset += font_width(
':'
)+1; delay_ms(0);
blink=1;
}
else
{
font_display(
' '
, offset); offset += font_width(
':'
)+1; delay_ms(0);
blink=0;
}
if
(M==0){
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
}
else
if
(M==1){
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
font_display(
'1'
, offset); offset += font_width(
'1'
)+1; delay_ms(0);
}
else
if
(M==2){
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
font_display(
'2'
, offset); offset += font_width(
'2'
)+1; delay_ms(0);
}
else
if
(M==3){
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
font_display(
'3'
, offset); offset += font_width(
'3'
)+1; delay_ms(0);
}
else
if
(M==3){
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
font_display(
'3'
, offset); offset += font_width(
'3'
)+1; delay_ms(0);
}
else
if
(M==4){
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
font_display(
'4'
, offset); offset += font_width(
'4'
)+1; delay_ms(0);
}
else
if
(M==5){
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
font_display(
'5'
, offset); offset += font_width(
'5'
)+1; delay_ms(0);
}
else
if
(M==6){
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
font_display(
'6'
, offset); offset += font_width(
'6'
)+1; delay_ms(0);
}
else
if
(M==7){
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
font_display(
'7'
, offset); offset += font_width(
'7'
)+1; delay_ms(0);
}
else
if
(M==8){
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
font_display(
'8'
, offset); offset += font_width(
'8'
)+1; delay_ms(0);
}
else
if
(M==9){
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
font_display(
'9'
, offset); offset += font_width(
'9'
)+1; delay_ms(0);
}
else
if
(M==10){
font_display(
'1'
, offset); offset += font_width(
'1'
)+1; delay_ms(0);
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
}
else
if
(M==11){
font_display(
'1'
, offset); offset += font_width(
'1'
)+1; delay_ms(0);
font_display(
'1'
, offset); offset += font_width(
'1'
)+1; delay_ms(0);
}
else
if
(M==12){
font_display(
'1'
, offset); offset += font_width(
'1'
)+1; delay_ms(0);
font_display(
'2'
, offset); offset += font_width(
'2'
)+1; delay_ms(0);
}
else
if
(M==13){
font_display(
'1'
, offset); offset += font_width(
'1'
)+1; delay_ms(0);
font_display(
'3'
, offset); offset += font_width(
'3'
)+1; delay_ms(0);
}
else
if
(M==14){
font_display(
'1'
, offset); offset += font_width(
'1'
)+1; delay_ms(0);
font_display(
'4'
, offset); offset += font_width(
'4'
)+1; delay_ms(0);
}
else
if
(M==15){
font_display(
'1'
, offset); offset += font_width(
'1'
)+1; delay_ms(0);
font_display(
'5'
, offset); offset += font_width(
'5'
)+1; delay_ms(0);
}
else
if
(M==16){
font_display(
'1'
, offset); offset += font_width(
'1'
)+1; delay_ms(0);
font_display(
'6'
, offset); offset += font_width(
'6'
)+1; delay_ms(0);
}
else
if
(M==17){
font_display(
'1'
, offset); offset += font_width(
'1'
)+1; delay_ms(0);
font_display(
'7'
, offset); offset += font_width(
'7'
)+1; delay_ms(0);
}
else
if
(M==18){
font_display(
'1'
, offset); offset += font_width(
'1'
)+1; delay_ms(0);
font_display(
'8'
, offset); offset += font_width(
'8'
)+1; delay_ms(0);
}
else
if
(M==19){
font_display(
'1'
, offset); offset += font_width(
'1'
)+1; delay_ms(0);
font_display(
'9'
, offset); offset += font_width(
'9'
)+1; delay_ms(0);
}
else
if
(M==20){
font_display(
'2'
, offset); offset += font_width(
'2'
)+1; delay_ms(0);
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
}
else
if
(M==21){
font_display(
'2'
, offset); offset += font_width(
'2'
)+1; delay_ms(0);
font_display(
'1'
, offset); offset += font_width(
'1'
)+1; delay_ms(0);
}
else
if
(M==22){
font_display(
'2'
, offset); offset += font_width(
'2'
)+1; delay_ms(0);
font_display(
'2'
, offset); offset += font_width(
'2'
)+1; delay_ms(0);
}
else
if
(M==23){
font_display(
'2'
, offset); offset += font_width(
'2'
)+1; delay_ms(0);
font_display(
'3'
, offset); offset += font_width(
'3'
)+1; delay_ms(0);
}
else
if
(M==24){
font_display(
'2'
, offset); offset += font_width(
'2'
)+1; delay_ms(0);
font_display(
'4'
, offset); offset += font_width(
'4'
)+1; delay_ms(0);
}
else
if
(M==25){
font_display(
'2'
, offset); offset += font_width(
'2'
)+1; delay_ms(0);
font_display(
'5'
, offset); offset += font_width(
'5'
)+1; delay_ms(0);
}
else
if
(M==26){
font_display(
'2'
, offset); offset += font_width(
'2'
)+1; delay_ms(0);
font_display(
'6'
, offset); offset += font_width(
'6'
)+1; delay_ms(0);
}
else
if
(M==27){
font_display(
'2'
, offset); offset += font_width(
'2'
)+1; delay_ms(0);
font_display(
'7'
, offset); offset += font_width(
'7'
)+1; delay_ms(0);
}
else
if
(M==28){
font_display(
'2'
, offset); offset += font_width(
'2'
)+1; delay_ms(0);
font_display(
'8'
, offset); offset += font_width(
'8'
)+1; delay_ms(0);
}
else
if
(M==29){
font_display(
'2'
, offset); offset += font_width(
'2'
)+1; delay_ms(0);
font_display(
'9'
, offset); offset += font_width(
'9'
)+1; delay_ms(0);
}
else
if
(M==30){
font_display(
'3'
, offset); offset += font_width(
'3'
)+1; delay_ms(0);
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
}
else
if
(M==31){
font_display(
'3'
, offset); offset += font_width(
'3'
)+1; delay_ms(0);
font_display(
'1'
, offset); offset += font_width(
'1'
)+1; delay_ms(0);
}
else
if
(M==32){
font_display(
'3'
, offset); offset += font_width(
'3'
)+1; delay_ms(0);
font_display(
'2'
, offset); offset += font_width(
'2'
)+1; delay_ms(0);
}
else
if
(M==33){
font_display(
'3'
, offset); offset += font_width(
'3'
)+1; delay_ms(0);
font_display(
'3'
, offset); offset += font_width(
'3'
)+1; delay_ms(0);
}
else
if
(M==34){
font_display(
'3'
, offset); offset += font_width(
'3'
)+1; delay_ms(0);
font_display(
'4'
, offset); offset += font_width(
'4'
)+1; delay_ms(0);
}
else
if
(M==35){
font_display(
'3'
, offset); offset += font_width(
'3'
)+1; delay_ms(0);
font_display(
'5'
, offset); offset += font_width(
'5'
)+1; delay_ms(0);
}
else
if
(M==36){
font_display(
'3'
, offset); offset += font_width(
'3'
)+1; delay_ms(0);
font_display(
'6'
, offset); offset += font_width(
'6'
)+1; delay_ms(0);
}
else
if
(M==37){
font_display(
'3'
, offset); offset += font_width(
'3'
)+1; delay_ms(0);
font_display(
'7'
, offset); offset += font_width(
'7'
)+1; delay_ms(0);
}
else
if
(M==38){
font_display(
'3'
, offset); offset += font_width(
'3'
)+1; delay_ms(0);
font_display(
'8'
, offset); offset += font_width(
'8'
)+1; delay_ms(0);
}
else
if
(M==39){
font_display(
'3'
, offset); offset += font_width(
'3'
)+1; delay_ms(0);
font_display(
'9'
, offset); offset += font_width(
'9'
)+1; delay_ms(0);
}
else
if
(M==40){
font_display(
'4'
, offset); offset += font_width(
'4'
)+1; delay_ms(0);
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
}
else
if
(M==41){
font_display(
'4'
, offset); offset += font_width(
'4'
)+1; delay_ms(0);
font_display(
'1'
, offset); offset += font_width(
'1'
)+1; delay_ms(0);
}
else
if
(M==42){
font_display(
'4'
, offset); offset += font_width(
'4'
)+1; delay_ms(0);
font_display(
'2'
, offset); offset += font_width(
'2'
)+1; delay_ms(0);
}
else
if
(M==43){
font_display(
'4'
, offset); offset += font_width(
'4'
)+1; delay_ms(0);
font_display(
'3'
, offset); offset += font_width(
'3'
)+1; delay_ms(0);
}
else
if
(M==44){
font_display(
'4'
, offset); offset += font_width(
'4'
)+1; delay_ms(0);
font_display(
'4'
, offset); offset += font_width(
'4'
)+1; delay_ms(0);
}
else
if
(M==45){
font_display(
'4'
, offset); offset += font_width(
'4'
)+1; delay_ms(0);
font_display(
'5'
, offset); offset += font_width(
'5'
)+1; delay_ms(0);
}
else
if
(M==46){
font_display(
'4'
, offset); offset += font_width(
'4'
)+1; delay_ms(0);
font_display(
'6'
, offset); offset += font_width(
'6'
)+1; delay_ms(0);
}
else
if
(M==47){
font_display(
'4'
, offset); offset += font_width(
'4'
)+1; delay_ms(0);
font_display(
'7'
, offset); offset += font_width(
'7'
)+1; delay_ms(0);
}
else
if
(M==48){
font_display(
'4'
, offset); offset += font_width(
'4'
)+1; delay_ms(0);
font_display(
'8'
, offset); offset += font_width(
'8'
)+1; delay_ms(0);
}
else
if
(M==49){
font_display(
'4'
, offset); offset += font_width(
'4'
)+1; delay_ms(0);
font_display(
'9'
, offset); offset += font_width(
'9'
)+1; delay_ms(0);
}
else
if
(M==50){
font_display(
'5'
, offset); offset += font_width(
'5'
)+1; delay_ms(0);
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
}
else
if
(M==51){
font_display(
'5'
, offset); offset += font_width(
'5'
)+1; delay_ms(0);
font_display(
'1'
, offset); offset += font_width(
'1'
)+1; delay_ms(0);
}
else
if
(M==52){
font_display(
'5'
, offset); offset += font_width(
'5'
)+1; delay_ms(0);
font_display(
'2'
, offset); offset += font_width(
'2'
)+1; delay_ms(0);
}
else
if
(M==53){
font_display(
'5'
, offset); offset += font_width(
'5'
)+1; delay_ms(0);
font_display(
'3'
, offset); offset += font_width(
'3'
)+1; delay_ms(0);
}
else
if
(M==54){
font_display(
'5'
, offset); offset += font_width(
'5'
)+1; delay_ms(0);
font_display(
'4'
, offset); offset += font_width(
'4'
)+1; delay_ms(0);
}
else
if
(M==55){
font_display(
'5'
, offset); offset += font_width(
'5'
)+1; delay_ms(0);
font_display(
'5'
, offset); offset += font_width(
'5'
)+1; delay_ms(0);
}
else
if
(M==56){
font_display(
'5'
, offset); offset += font_width(
'5'
)+1; delay_ms(0);
font_display(
'6'
, offset); offset += font_width(
'6'
)+1; delay_ms(0);
}
else
if
(M==57){
font_display(
'5'
, offset); offset += font_width(
'5'
)+1; delay_ms(0);
font_display(
'7'
, offset); offset += font_width(
'7'
)+1; delay_ms(0);
}
else
if
(M==58){
font_display(
'5'
, offset); offset += font_width(
'5'
)+1; delay_ms(0);
font_display(
'8'
, offset); offset += font_width(
'8'
)+1; delay_ms(0);
}
else
if
(M==59){
font_display(
'5'
, offset); offset += font_width(
'5'
)+1; delay_ms(0);
font_display(
'9'
, offset); offset += font_width(
'9'
)+1; delay_ms(0);
}
else
if
(M==60){
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
font_display(
'0'
, offset); offset += font_width(
'0'
)+1; delay_ms(0);
M=0;
H++;
}
offset += font_width(
'0'
);
if
(AM==1){
font_display(
'A'
, offset); offset += font_width(
'A'
)+1; delay_ms(0);
}
else
{
font_display(
'P'
, offset); offset += font_width(
'P'
)+1; delay_ms(0);
}
if
(S==60){
S=0;
M++;
}
delay_ms(871);
S++;
}
}