Alarmlı Saat Devresi CCS de hata alıyorum yardım

Katılım
25 Mar 2017
Mesajlar
1
Puanları
1
Yaş
28
arkadaşlar benim alarmlı saat projem var ödev olarak aşağıda ki kodlarda f9 a basınca 11 tane hata çıkıyor yarın son gün acil yardım edebilir misiniz?

#include <18f452.h>
#device adc=10
#device *=16
#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //High speed Osc (> 4mhz)
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOBROWNOUT //Reset when brownout detected
#FUSES NOPUT //No Power Up Timer
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#use delay(clock=20000000)
#include <HDM64GS12x.c>
#include <graphics.c>
#define RTC_SCLK PIN_a1 //DS1302 için pin tanımlamaları
#define RTC_IO PIN_a2
#define RTC_RST PIN_a0
#define TONE_PIN PIN_B6
#include <ds1302.c>
#include <TONES.c>
#use fast_io(A)

#define alarm pin_c4
#define led2 pin_c5


const char happy_bday[50] = {
C_note[0],350, C_note[0],100, D_note[0],500, C_note[0],500, F_note[0],500, E_note[0],900,
C_note[0],350, C_note[0],100, D_note[0],500, C_note[0],500, G_note[0],500, F_note[0],900,
C_note[0],350, C_note[0],100, C_note[1],500, A_note[0],500, F_note[0],500, E_note[0],500, D_note[0],900,
Bb_note[0],350, Bb_note[0],100, A_note[0],500, F_note[0],500, G_note[0],500, F_note[0],1200};

int i; // Tam sayı tipinde değişken tanımlanıyor

char gun1[]="PAZAR";
char gun2[]="PAZARTESi";
char gun3[]="SALI";
char gun4[]="CARSAMBA";
char gun5[]="PERSEMBE";
char gun6[]="CUMA";
char gun7[]="CUMARTESi";
int8 t_sabit;
int8 say;
int8 menu;
int8 tab;
int Ekran;
int8 cikis;
int8 alarm_s;
int8 bekle_s;
int1 ses;
char tmp[]= "SAAT";
char tmp1[]= "TARiH";
char tmp2[]= "ALARM";
char tmp3[]= "AYAR";
char tmp4[]= "KOCATEPETEK";
char ayar1[]= "Alarm Suresi:";
char ayar2[]= "Bekleme Suresi:";
char ayar3[]= "Sesli Uyari:";
char ses_1[]="On";
char ses_2[]="Off";
char s_alarm_s[2];
char s_bekle_s[2];
int saniye,dakika,saat,gun,ay,yil,haftanin_gunu;
int a_saat,a_dakika;
char s_saat[2];
char s_dakika[2];
char s_saniye[2];
char a_s_saat[2];
char a_s_dakika[2];
char s_gun[2];
char s_ay[2];
char s_yil[2];
char nokta[2]=":";
#int_timer0 // Timer0 kesmesi
void timer0_kesme () // Kesme fonksiyonu ismi
{

if(ses==1){
i=i+1;
if(i==50){
i=0;
}
generate_tone(happy_bday,90); // Sırayla muzık[] dizisindeki
}
}

void acilis(){
for(i=0; i<2; ++i){
glcd_fillscreen(off);
glcd_text57(6,10,tmp4,2,on);
glcd_text57(14,35,tmp5,1,on);
glcd_pixel(62,43,off);
glcd_pixel(38,58,on);
glcd_pixel(86,58,on);
delay_ms(1500);
glcd_fillscreen(on);
glcd_text57(6,10,tmp4,2,off);
glcd_text57(14,35,tmp5,1,off);
glcd_pixel(62,43,on);
glcd_pixel(38,58,off);
glcd_pixel(86,58,off);
delay_ms(1500);
}
}
void haftanin_gunu_yaz(int8 haftanin_gunu_sec){
switch(haftanin_gunu_sec){ //
case 1:glcd_text57(35,40+t_sabit,gun1,2,on);break; //
case 2:glcd_text57(15,40+t_sabit,gun2,2,on);break; //
case 3:glcd_text57(42,40+t_sabit,gun3,2,on);break; //
case 4:glcd_text57(19,40+t_sabit,gun4,2,on);break; //
case 5:glcd_text57(19,40+t_sabit,gun5,2,on);break; //
case 6:glcd_text57(40,40+t_sabit,gun6,2,on);break; //
case 7:glcd_text57(16,40+t_sabit,gun7,2,on);break;}
}
void haftanin_gunu_sil(){
glcd_rect(2+t_sabit,39+t_sabit,113,62,yes,off);}
void slash(){
glcd_line(42,28,38,41,on);
glcd_line(43,28,39,41,on);
glcd_line(88,28,84,41,on);
glcd_line(89,28,85,41,on);
}
void tab_yerlestir(int8 tab_no){
if(ekran!=4){
switch(tab_no){
case 0:
if(menu==1){
glcd_rect(8,45,114,63,no,off);
}
glcd_rect(3,32-t_sabit,33,51-t_sabit,no,ON);
glcd_rect(48,32-t_sabit,80,51-t_sabit,no,off);
glcd_rect(94,32-t_sabit,123,51-t_sabit,no,off);
break;
case 1:
glcd_rect(3,32-t_sabit,33,51-t_sabit,no,off);
glcd_rect(48,32-t_sabit,80,51-t_sabit,no,ON);
glcd_rect(94,32-t_sabit,123,51-t_sabit,no,off);
break;
case 2:
glcd_rect(3,32-t_sabit,33,51-t_sabit,no,off);
glcd_rect(48,32-t_sabit,80,51-t_sabit,no,off);
glcd_rect(94,32-t_sabit,123,51-t_sabit,no,ON);
break;
case 3:
glcd_rect(3,32-t_sabit,33,51-t_sabit,no,off);
glcd_rect(48,32-t_sabit,80,51-t_sabit,no,off);
glcd_rect(94,32-t_sabit,123,51-t_sabit,no,off);
glcd_rect(8,45,114,63,no,on);
break;
}}
if(ekran==4){
switch(tab_no){
case 0:
glcd_rect(95,22,120,34,no,ON);
glcd_rect(95,37,120,49,no,off);
glcd_rect(95,52,120,63,no,off);
break;
case 1:
glcd_rect(95,22,120,34,no,off);
glcd_rect(95,37,120,49,no,on);
glcd_rect(95,52,120,63,no,off);
break;
case 2:
glcd_rect(95,22,120,34,no,off);
glcd_rect(95,37,120,49,no,off);
glcd_rect(95,52,120,63,no,on);
break;
}}
}
void menu_temizle(){
glcd_fillScreen(off);} // MENÜ TEMİZLE
void menu_ekran(int8 menum){
switch(menum){
case 0: //---------------------------------
glcd_rect(0,1,60,30,yes,ON); //
glcd_rect(0,34,60,63,yes,off); //
glcd_rect(0,34,60,63,NO,ON); //
glcd_rect(67,1,127,30,yes,off); //
glcd_rect(67,1,127,30,NO,ON); // SAAT BUTONU
glcd_rect(67,34,127,63,yes,off); //
glcd_rect(67,34,127,63,NO,ON); //
glcd_text57(10,9,tmp,2,off); //
glcd_text57(3,42,tmp1,2,on); //
glcd_text57(71,9,tmp2,2,on); //
glcd_text57(76,42,tmp3,2,on);menu=0;break; //---------------------------------
case 1:
glcd_rect(0,1,60,30,yes,off); //---------------------------------
glcd_rect(0,1,60,30,no,on); //
glcd_rect(0,34,60,63,NO,ON); //
glcd_rect(0,34,60,63,yes,on); // TARİH BUTONU
glcd_rect(67,1,127,30,yes,off); //
glcd_rect(67,1,127,30,no,on); //
glcd_text57(10,9,tmp,2,on); //
glcd_text57(3,42,tmp1,2,off); //
glcd_text57(71,9,tmp2,2,on);menu=1;break; //---------------------------------
case 2:
glcd_rect(0,1,60,30,yes,off); //---------------------------------
glcd_rect(0,1,60,30,no,on); //
glcd_rect(0,34,60,63,yes,off); //
glcd_rect(0,34,60,63,NO,ON); //
glcd_rect(67,1,127,30,yes,on); // ALARM BUTONU
glcd_rect(67,34,127,63,yes,off); //
glcd_rect(67,34,127,63,no,on); //
glcd_text57(10,9,tmp,2,on); //
glcd_text57(3,42,tmp1,2,on); //
glcd_text57(71,9,tmp2,2,off); //
glcd_text57(76,42,tmp3,2,on);menu=2;break; //---------------------------------
case 3:
glcd_rect(67,1,127,30,yes,off); //---------------------------------
glcd_rect(67,1,127,30,no,on); //
glcd_rect(67,34,127,63,yes,on); //
glcd_rect(0,1,60,30,yes,off); //
glcd_rect(0,1,60,30,no,ON); // AYAR BUTONU
glcd_text57(10,9,tmp,2,on); //
glcd_text57(3,42,tmp1,2,on); //
glcd_text57(71,9,tmp2,2,on); //
glcd_text57(76,42,tmp3,2,off);menu=3;break;}}//---------------------------------
void main(){
setup_psp(psp_disabled);
setup_spi(spi_ss_disabled);
setup_timer_0(RTCC_INTERNAL);
setup_timer_1(t1_disabled);
setup_timer_2(t2_disabled,0,1);
setup_ccp1(ccp_off);
setup_ccp2(ccp_off);
SET_TRIS_A(0b11111111);
set_tris_c(0x0f);
set_tris_b(0x00);
setup_timer_0(RTCC_INTERNAL | RTCC_DIV_2); // Timer0 ayarları yapılıyor
set_timer0(10); // TMR0 değeri belirleniyor
output_c(0x0f);
glcd_init(on);
delay_ms(200);
acilis();
rtc_init();
if (a_saat>=0){
a_saat=read_eeprom(0);
a_dakika=read_eeprom(5);
}
alarm_s=read_eeprom(10);
bekle_s=read_eeprom(15);
ses=read_eeprom(20);
ekran:
menu_temizle(); // Tarih bilgisini Siler
while(1){
if(input(PIN_C0)==0 && input(PIN_C3)==1){
menu_temizle();
menu=0;
ekran=0;
menu_ekran(0);
while(1){
menuler:
if (ekran==0){
if(input(PIN_C1)==0){
if(menu==0){
menu=4;}
menu=menu-1;
menu_ekran(menu);
delay_ms(100);}
if(input(PIN_C2)==0){
if(menu==4){
menu=0;
menu=menu-1;}
menu=menu+1;
menu_ekran(menu);
delay_ms(100);}
}
if (input(PIN_C3)==0){
menu_temizle();
glcd_rect(0,0,127,20,no,ON);
switch(menu){
case 0:
tab_yerlestir(0);
glcd_rect(0,0,127,20,no,ON);
glcd_text57(20,3,tmp,2,on);
glcd_text57(70,3,tmp3,2,on);
glcd_rect(38,34,42,38,yes,ON); //---------------------------------
glcd_rect(38,44,42,48,yes,ON); //
glcd_rect(85,34,89,38,yes,ON); //
glcd_rect(85,44,89,48,yes,ON); //
sprintf(s_saat,"%02d",saat); // Saat bilgisini ekrana yazar
glcd_text57(6,35,s_saat,2,on); //
sprintf(s_dakika,"%02d",dakika); //
glcd_text57(53,35,s_dakika,2,on);
saniye=0; //
sprintf(s_saniye,"%02d",saniye); //
glcd_text57(98,35,s_saniye,2,on);
ekran=1;
if (ekran==1){
while(1){
tab=0;
//--------------------------------SAAT AYAR-------------------------------------
if(input(PIN_C3)==0){
if(tab==1){
tab=0;
tab=tab-1;}
tab=tab+1;
tab_yerlestir(tab);
delay_ms(300);}
if(input(PIN_C1)==0){
if (tab==0){
sprintf(s_saat,"%02d",saat);
glcd_text57(6,35,s_saat,2,off);
if(saat<24){
saat=saat+1;}
if(saat==24){
saat=0;}
tab_yerlestir(tab);
glcd_rect(38,34,42,38,yes,ON);
glcd_rect(38,44,42,48,yes,ON);
sprintf(s_saat,"%02d",saat);
glcd_text57(6,35,s_saat,2,on);
glcd_text57(53,35,s_dakika,2,on);
delay_ms(200);}
if(tab==1){
sprintf(s_dakika,"%02d",dakika);
glcd_text57(53,35,s_dakika,2,off);
if(dakika<60){
dakika=dakika+1;}
if(dakika==60){
dakika=0;}
sprintf(s_dakika,"%02d",dakika);
glcd_text57(53,35,s_dakika,2,on);
glcd_rect(85,34,89,38,yes,ON);
glcd_rect(85,44,89,48,yes,ON);
delay_ms(200);}}
if(input(PIN_C2)==0){
if (tab==0){
sprintf(s_saat,"%02d",saat);
glcd_text57(6,35,s_saat,2,off);
if(saat>0){
saat=saat-1;}
if(saat==0){
saat=23;}
sprintf(s_saat,"%02d",saat);
glcd_text57(6,35,s_saat,2,on);
glcd_text57(53,35,s_dakika,2,on);
glcd_text57(6,35,s_saat,2,on);
tab_yerlestir(tab);
glcd_rect(38,34,42,38,yes,ON);
glcd_rect(38,44,42,48,yes,ON);
delay_ms(200);}
if(tab==1){
sprintf(s_dakika,"%02d",dakika);
glcd_text57(53,35,s_dakika,2,off);
if(dakika>0){
dakika=dakika-1;}
if(dakika==0){
dakika=59;}
sprintf(s_dakika,"%02d",dakika);
glcd_text57(53,35,s_dakika,2,on);
tab_yerlestir(tab);
glcd_rect(85,34,89,38,yes,ON);
glcd_rect(85,44,89,48,yes,ON);
delay_ms(200);
}}
if(input(PIN_C0)==0 && input(PIN_C3)==0){
rtc_set_datetime(gun,ay,yil,haftanin_gunu,saat,dakika);
menu_temizle();
goto goster;}
if(input(PIN_C0)==0){
menu_temizle();
goto goster;
}}}
//--------------------------------SAAT AYAR BİTİŞ-------------------------------
//--------------------------------TARİH AYAR------------------------------------
break;
case 1:
glcd_text57(12,3,tmp1,2,on);
glcd_text57(72,3,tmp3,2,on);
slash();
sprintf(s_gun,"%02d",gun);
glcd_text57(6,28,s_gun,2,on);
sprintf(s_ay,"%02d",ay);
glcd_text57(53,28,s_ay,2,on);
sprintf(s_yil,"%02d",yil);
glcd_text57(98,28,s_yil,2,on);
t_sabit=7;
haftanin_gunu_yaz(haftanin_gunu);
tab_yerlestir(0);
ekran=2;
if (ekran==2){
while(1){
if(input(PIN_C3)==0){
if(tab==3){
tab=0;
tab=tab-1;}
tab=tab+1;
tab_yerlestir(tab);
delay_ms(300);}
if(input(PIN_C1)==0){
if (tab==0){
sprintf(s_gun,"%02d",gun);
glcd_text57(6,28,s_gun,2,off);
if(gun<32){
gun=gun+1;}
if(gun==32){
gun=0;}
sprintf(s_gun,"%02d",gun);
glcd_text57(6,28,s_gun,2,on);
glcd_text57(98,28,s_yil,2,off);
glcd_text57(98,28,s_yil,2,on);
slash();
tab_yerlestir(tab);
delay_ms(200);}
if(tab==1){
sprintf(s_ay,"%02d",ay);
glcd_text57(53,28,s_ay,2,off);
if(ay<13){
ay=ay+1;}
if(ay==13){
ay=1;}
sprintf(s_ay,"%02d",ay);
glcd_text57(53,28,s_ay,2,on);
glcd_text57(98,28,s_yil,2,on);
slash();
tab_yerlestir(tab);
delay_ms(200);}
if(tab==2){
sprintf(s_yil,"%02d",yil);
glcd_text57(98,28,s_yil,2,off);
if(yil<100){
yil=yil+1;}
if(yil==100){
yil=0;}
sprintf(s_yil,"%02d",yil);
glcd_text57(98,28,s_yil,2,on);
tab_yerlestir(tab);
delay_ms(200);}
if(tab==3){
if(haftanin_gunu<8){
haftanin_gunu=haftanin_gunu+1;}
if(haftanin_gunu==8){
haftanin_gunu=1;}
haftanin_gunu_sil();
haftanin_gunu_yaz(haftanin_gunu);
tab_yerlestir(tab);
delay_ms(200);}
}
if(input(PIN_C2)==0){
if (tab==0){
sprintf(s_gun,"%02d",gun);
glcd_text57(6,28,s_gun,2,off);
if(gun>0){
gun=gun-1;}
if(gun==0){
saat=31;}
sprintf(s_gun,"%02d",gun);
glcd_text57(6,28,s_gun,2,on);
slash();
tab_yerlestir(tab);
delay_ms(200);}
if(tab==1){
sprintf(s_ay,"%02d",ay);
glcd_text57(53,28,s_ay,2,off);
if(ay>0){
ay=ay-1;}
if(ay==0){
ay=12;}
sprintf(s_ay,"%02d",ay);
glcd_text57(53,28,s_ay,2,on);
slash();
tab_yerlestir(tab);
delay_ms(200);}
if(tab==2){
sprintf(s_yil,"%02d",yil);
glcd_text57(98,28,s_yil,2,off);
if(yil>0){
yil=yil-1;}
if(yil==0){
yil=99;}
sprintf(s_yil,"%02d",yil);
glcd_text57(98,28,s_yil,2,on);
tab_yerlestir(tab);
delay_ms(200);}
if(tab==3){
if(haftanin_gunu>1){
haftanin_gunu=haftanin_gunu-1;}
if(haftanin_gunu==1){
haftanin_gunu=7;}
haftanin_gunu_sil();
haftanin_gunu_yaz(haftanin_gunu);
tab_yerlestir(tab);
delay_ms(200);}}
if(input(PIN_C0)==0 && input(PIN_C3)==0){
rtc_set_datetime(gun,ay,yil,haftanin_gunu,saat,dakika);
menu_temizle();
goto goster;}
if(input(PIN_C0)==0){
menu_temizle();
goto goster;
}}}
//--------------------------------TARİH AYAR BİTİŞ------------------------------
//--------------------------------ALARM AYAR------------------------------------
break;
case 2:
if (a_saat>=0){
a_saat=read_eeprom(0);
a_dakika=read_eeprom(5);}
tab_yerlestir(0);
glcd_text57(12,3,tmp2,2,on);
glcd_text57(72,3,tmp3,2,on);
glcd_rect(38,34,42,38,yes,ON);
glcd_rect(38,44,42,48,yes,ON);
glcd_rect(85,34,89,38,yes,ON);
glcd_rect(85,44,89,48,yes,ON);
sprintf(s_saat,"%02d",a_saat);
glcd_text57(6,35,s_saat,2,on);
sprintf(s_dakika,"%02d",a_dakika);
glcd_text57(53,35,s_dakika,2,on);
saniye=0;
sprintf(s_saniye,"%02d",saniye);
glcd_text57(98,35,s_saniye,2,on);
ekran=3;
if (ekran==3){
while(1){
if(input(PIN_C3)==0){
if(tab==1){
tab=0;
tab=tab-1;}
tab=tab+1;
tab_yerlestir(tab);
delay_ms(300);}
if(input(PIN_C1)==0){
if (tab==0){
sprintf(s_saat,"%02d",a_saat);
glcd_text57(6,35,s_saat,2,off);
if(a_saat<24){
a_saat=a_saat+1;}
if(a_saat==24){
a_saat=0;}
sprintf(s_saat,"%02d",a_saat);
glcd_text57(6,35,s_saat,2,on);
glcd_rect(38,34,42,38,yes,ON);
glcd_rect(38,44,42,48,yes,ON);
tab_yerlestir(tab);
delay_ms(200);}
if(tab==1){
sprintf(s_dakika,"%02d",a_dakika);
glcd_text57(53,35,s_dakika,2,off);
if(a_dakika<60){
a_dakika=a_dakika+1;}
if(a_dakika==60){
a_dakika=0;}
sprintf(s_dakika,"%02d",a_dakika);
glcd_text57(53,35,s_dakika,2,on);
glcd_rect(85,34,89,38,yes,ON);
glcd_rect(85,44,89,48,yes,ON);
tab_yerlestir(tab);
delay_ms(200);}}
if(input(PIN_C2)==0){
if (tab==0){
sprintf(s_saat,"%02d",a_saat);
glcd_text57(6,35,s_saat,2,off);
if(a_saat>0){
a_saat=a_saat-1;}
if(a_saat==0){
a_saat=23;}
sprintf(s_saat,"%02d",a_saat);
glcd_text57(6,35,s_saat,2,on);
glcd_text57(53,35,s_dakika,2,on);
glcd_text57(6,35,s_saat,2,on);
glcd_rect(38,34,42,38,yes,ON);
glcd_rect(38,44,42,48,yes,ON);
tab_yerlestir(tab);
delay_ms(200);}
if(tab==1){
sprintf(s_dakika,"%02d",a_dakika);
glcd_text57(53,35,s_dakika,2,off);
if(a_dakika>0){
a_dakika=a_dakika-1;}
if(a_dakika==0){
a_dakika=59;}
sprintf(s_dakika,"%02d",a_dakika);
glcd_text57(53,35,s_dakika,2,on);
//glcd_text57(6,35,s_saat,2,on);
glcd_rect(85,34,89,38,yes,ON);
glcd_rect(85,44,89,48,yes,ON);
tab_yerlestir(tab);
delay_ms(200);
}}
if(input(PIN_C0)==0 && input(PIN_C3)==0){
write_eeprom(0,a_saat);
write_eeprom(5,a_dakika);
menu_temizle();
goto goster;}
if(input(PIN_C0)==0){
menu_temizle();
goto goster;
}}}
break;
//--------------------------------ALARM AYAR BİTİŞ------------------------------
//--------------------------------AYARLAR---------------------------------------
case 3:
ekran=4;
tab_yerlestir(0);
glcd_text57(43,3,tmp3,2,on);
glcd_text57(5,25,ayar1,1,on);
glcd_text57(5,40,ayar2,1,on);
glcd_text57(5,55,ayar3,1,on);
glcd_pixel(50,25,yes);
glcd_pixel(48,25,yes);
glcd_pixel(62,40,yes);
glcd_pixel(60,40,yes);
glcd_pixel(67,55,no);
sprintf(s_alarm_s,"%02d",alarm_s);
glcd_text57(100,25,s_alarm_s,1,on);
sprintf(s_bekle_s,"%02d",bekle_s);
glcd_text57(100,40,s_bekle_s,1,on);
if(ses==0){
glcd_text57(100,55,ses_2,1,on);
}
if(ses==1){
glcd_text57(100,55,ses_1,1,on);
}

if (ekran==4){
while(1){
if(input(PIN_C3)==0){
if(tab==2){
tab=0;
tab=tab-1;}
tab=tab+1;
tab_yerlestir(tab);
delay_ms(300);}
if(input(PIN_C1)==0){
if (tab==0){
sprintf(s_alarm_s,"%02d",alarm_s);
glcd_text57(100,25,s_alarm_s,1,off);
if(alarm_s<60){
alarm_s=alarm_s+1;}
if(alarm_s==60){
alarm_s=0;}
sprintf(s_alarm_s,"%02d",alarm_s);
glcd_text57(100,25,s_alarm_s,1,on);
tab_yerlestir(tab);
delay_ms(200);}
if(tab==1){
sprintf(s_bekle_s,"%02d",bekle_s);
glcd_text57(100,40,s_bekle_s,1,off);
if(bekle_s<100){
bekle_s=bekle_s+1;}
if(bekle_s==100){
bekle_s=0;}
sprintf(s_bekle_s,"%02d",bekle_s);
glcd_text57(100,40,s_bekle_s,1,on);
tab_yerlestir(tab);
delay_ms(200);}
if(tab==2){
ses=ses+1;
if(ses==0){
glcd_text57(100,55,ses_1,1,off);
glcd_text57(100,55,ses_2,1,on);
}
if(ses==1){
glcd_text57(100,55,ses_2,1,off);
glcd_text57(100,55,ses_1,1,on);
}
tab_yerlestir(tab);
delay_ms(200);}
}
if(input(PIN_C2)==0){
if (tab==0){
sprintf(s_alarm_s,"%02d",alarm_s);
glcd_text57(100,25,s_alarm_s,1,off);
if(alarm_s>0){
alarm_s=alarm_s-1;}
if(alarm_s==0){
alarm_s=60;}
sprintf(s_alarm_s,"%02d",alarm_s);
glcd_text57(100,25,s_alarm_s,1,on);
tab_yerlestir(tab);
delay_ms(200);}
if(tab==1){
sprintf(s_bekle_s,"%02d",bekle_s);
glcd_text57(100,40,s_bekle_s,1,off);
if(bekle_s>0){
bekle_s=bekle_s-1;}
if(bekle_s==0){
bekle_s=100;}
sprintf(s_bekle_s,"%02d",bekle_s);
glcd_text57(100,40,s_bekle_s,1,on);
tab_yerlestir(tab);
delay_ms(200);
}
if(tab==2){
ses=ses-1;
if(ses==0){
glcd_text57(100,55,ses_1,1,off);
glcd_text57(100,55,ses_2,1,on);
}
if(ses==1){
glcd_text57(100,55,ses_2,1,off);
glcd_text57(100,55,ses_1,1,on);
}
tab_yerlestir(tab);
delay_ms(200);}
}
if(input(PIN_C0)==0 && input(PIN_C3)==0){
write_eeprom(10,alarm_s);
write_eeprom(15,bekle_s);
write_eeprom(20,ses);
menu_temizle();
goto goster;}
if(input(PIN_C0)==0){
menu_temizle();
goto goster;
}}}
break;}}
//--------------------------------AYARLAR BİTİŞ---------------------------------
if(input(PIN_C0)==0){
menu_temizle();
say=0;
goto goster;}}}
goster:
if (a_saat>0 || a_dakika>0){ //---------------------------------
a_saat=read_eeprom(0); //
a_dakika=read_eeprom(5); //
glcd_circle(20,50,11,no,ON); //
glcd_circle(20,50,10,no,ON); //
glcd_line(20,50,28,50,yes); //
glcd_line(20,50,20,42,yes); //
glcd_line(16,61,24,61,yes); // Alarm bilgisini ekrana yazar
glcd_line(15,62,25,62,yes); //
glcd_line(14,63,26,63,yes); //
glcd_rect(69,47,72,50,yes,ON); //
glcd_rect(69,54,72,57,yes,ON); //
sprintf(a_s_saat,"%02d",a_saat); //
glcd_text57(40,45,a_s_saat,2,on); //
sprintf(a_s_dakika,"%02d",a_dakika); //
glcd_text57(81,45,a_s_dakika,2,on);} //---------------------------------

rtc_get_time(saat,dakika,saniye);
rtc_get_date(gun,ay,yil,haftanin_gunu);
t_sabit=0;
if (saat==a_saat && dakika==a_dakika){
if(saniye<alarm_s){
output_high(alarm);
enable_interrupts(INT_timer0); // int_timer0 kesmesini aktif yapar
enable_interrupts(GLOBAL);
}
if(saniye>=alarm_s){
output_low(alarm);
disable_interrupts(INT_timer0); // int_timer0 kesmesini aktif yapar
disable_interrupts(GLOBAL);
}
}
glcd_rect(38,14,42,18,yes,ON); //---------------------------------
glcd_rect(38,24,42,28,yes,ON); //
glcd_rect(85,14,89,18,yes,ON); //
glcd_rect(85,24,89,28,yes,ON); //
sprintf(s_saat,"%02d",saat); // Saat bilgisini ekrana yazar
glcd_text57(3,10,s_saat,3,on); //
sprintf(s_dakika,"%02d",dakika); //
glcd_text57(50,10,s_dakika,3,on); //
sprintf(s_saniye,"%02d",saniye); //
glcd_text57(95,10,s_saniye,3,on); //---------------------------------
say=say+1;
if (say==bekle_s*5){
menu_temizle(); // Saat bilgisini siler
while(1){
rtc_get_time(saat,dakika,saniye);
if (saat==a_saat && dakika==a_dakika){
if(saniye<alarm_s){
output_high(alarm);
enable_interrupts(INT_timer0); // int_timer0 kesmesini aktif yapar
enable_interrupts(GLOBAL);
}
if(saniye>=alarm_s){
output_low(alarm);
disable_interrupts(INT_timer0); // int_timer0 kesmesini aktif yapar
disable_interrupts(GLOBAL);
}
}
sprintf(s_gun,"%02d",gun); //---------------------------------
glcd_text57(3,10,s_gun,3,on); //
sprintf(s_ay,"%02d",ay); //
glcd_text57(49,10,s_ay,3,on); //
sprintf(s_yil,"%02d",yil); // Tarih bilgisini ekrana yazar
glcd_text57(95,10,s_yil,3,on); //
glcd_line(42,10,38,30,on); //
glcd_line(43,10,39,30,on); //
glcd_line(88,10,84,30,on); //
glcd_line(89,10,85,30,on); //
haftanin_gunu_yaz(haftanin_gunu); //---------------------------------
say=say+1;
delay_ms(100);
if (say==bekle_s+(bekle_s*10)){
say=0;
goto ekran;}
if(input(PIN_C0)==0 && input(PIN_C3)==1){
menu_temizle();
menu=0;
ekran=0;
menu_ekran(0);
goto menuler;}
}}
delay_ms(100);
if (saniye>=59){ //---------------------------------
glcd_text57(50,10,s_dakika,3,off);} //
if (dakika>=59 && saniye>=59){ // Saat bilgisi yenileme
glcd_text57(3,10,s_saat,3,off);} //
glcd_text57(95,10,s_saniye,3,off);} //---------------------------------
}
 

Forum istatistikleri

Konular
129,806
Mesajlar
930,281
Kullanıcılar
452,608
Son üye
murat620

Yeni konular

Çevrimiçi üyeler

Geri
Üst