#include <16F628A.h>
#use delay(internal=4m)
#fuses nomclr,NOWDT,NOPROTECT,NOBROWNOUT,NOLVP,NOPUT,NOCPD
#include <ds1307_1.c>
#use fast_io(a)
#use fast_io(b)
unsigned int i,say=0;
byte hr,min,sec,day,mth,year,dow,hr1,hr2,min1,min2;
//harf tanımlamlamaları
const unsigned char dizi[]={
0xFF,0x02,0x0C,0x02,0xFF,0x00,0x00, //
0x00,0x00,0xc0,0xc0,0x00,0x00,0x00, //
0xFC,0x12,0x11,0x12,0xfc,0x00,0x00, //
0xFF,0x11,0x31,0x51,0x8E,0x00,0x00, //
0x00,0x81,0xFf,0x81,0x00,0x00,0x00, //
0x00,0x00,0x00,0x00,0x00,0x00,0x00, // Bosluk
0x00,0x00,0x00,0x00,0x00,0x00,0x00, // Bosluk
0x00,0x3e,0x81,0x01,0x81,0x3e,0x00, // u
0x00,0x81,0x42,0x24,0x18,0xff,0x00, // k
0x00,0x3f,0x48,0x88,0x58,0x3f,0x00, // a
0x00,0xff,0x40,0x30,0x40,0xff,0x00, // M
};
const unsigned char rakam[]={
62,81,73,69,62,0, //0
0,66,127,64,0,0, //1
66,97,81,73,70,0, //2
33,65,69,75,49,0, //3
24,20,18,127,16,0, //4
39,69,69,69,57,0, //5
60,74,73,73,48,0, //6
1,1,121,5,3,0, //7
54,73,73,73,54,0, //8
6,73,73,41,30,0, //9
};
void main(){
set_tris_b(0x00);
set_tris_a(0x40);
ds1307_init(DS1307_ALL_DISABLED); ///
//ds1307_init(DS1307_OUT_ENABLED | DS1307_OUT_1_HZ);
//ds1307_set_date_time(20,4,10,17,9,12,1);
for(;
{
if(input(pin_A6)==1) //eğer reed röle ye sinyal gelirse
{
say++;
if(say>=200)say=0;
if(say>=0 && say <=100)
{
for(i=0;i<77;i++)
{
output_b(dizi
);
Delay_Ms(1); // 1ms bekle
if ((i>=0) & (i<=28))
output_high(pin_a7);
else
output_low(pin_a7);
}
}
if(say>=101 && say <=200)
{
ds1307_get_time(hr,min,sec);
// hour=43;
// min=21;
hr1=hr%10;
hr2=hr/10;
min1=min%10;
min2=min/10;
i=0;
for(i=(6*hr2);i<=(6*hr2+5);i++)
{
output_b(rakam);
Delay_Ms(1); // 1ms bekle
}
output_b(0x00);
Delay_Ms(2); // 1ms bekle
i=0;
for(i=(6*hr1);i<=(6*hr1+5);i++)
{
output_b(rakam);
Delay_Ms(1); // 1ms bekle
}
output_b(0x00);
Delay_Ms(2); // 1ms bekle
output_b(36);
Delay_Ms(2); // 1ms bekle
output_b(0x00);
Delay_Ms(2); // 1ms bekle
// //
i=0;
for(i=(6*min2);i<=(6*min2+5);i++)
{
output_b(rakam);
Delay_Ms(1); // 1ms bekle
}
output_b(0x00);
Delay_Ms(2); // 1ms bekle
i=0;
for(i=(6*min1);i<=(6*min1+5);i++)
{
output_b(rakam);
Delay_Ms(1); // 1ms bekle
}
output_b(0x00);
}
}
}
}