avatar_ete

Alarm Saat (picbasic pro, pic16f877, pcf8583)

Başlatan ete, 28 Ağustos 2011, 14:02:42

Cesar35

IT'S JUST A QUESTION ?
WOULD YOU BE ABLE TO RESET THE ALARMS AUTOMATICALLY WHEN FINISHED
THANK YOU A HUG

ete

#31
can be!!. I will think about it. But be sure it will be long process.
I try to explain one alarm how to cancell than you can understand or may be you can do by yourself that cancellation for each alarm.

Let consider first alarm (Yer=1) is on and after a periode that alaram will be off. We will cancel (delete) that alarm.
We need to start on off process. There is a LABEL as ALARM_KONTROL. Under that label the alarms are made on and also off.
If Yer number is 8, means nr.1 alarm will be closed. Than we can start to delete it.
The place is given on below,
      YER=8
      gosub ALARM_OKU
      IF SIMDI=ZAMAN THEN PORTC=PORTC | %11111110  
We have to add the following lines;
- We first delete the open time of this alarm (Yer=1)
  yer=1:Temp=yer*8: Write temp,255,255,255,255,255:pause 10' (hour-min-Day-Month and year has been made as 255)
- Second, we have to delete the off time (Yer=8)
  Yer=8:Temp=Yer*8:write Temp,255,255,255,255,255,255:pause 10

Thats all. You must know that Nr.1 alarm has been deleted and you can re-enter there the ne alarm in case if necessary.
You should do all these delete process to the off alarms between Yer=8 and Yer=14. No need to do them to open alarms. 

Ete

Cesar35

Thank you my friend
I'll try.
thank you from the heart

Cesar35

#33
hello my friend
and this way you said
the i did wrong
eeprom variables clears normally
door c alarm is still on
thanks

 'YER=8
	  Yer=2:Temp=Yer*8:write Temp,255,255,255,255,255,255:pause 10
      gosub ALARM_OKU
      IF SIMDI=ZAMAN THEN PORTC=PORTC & %11111110    
      'YER=09
	  Yer=9:Temp=Yer*8:write Temp,255,255,255,255,255,255:pause 10
      GOSUB ALARM_OKU
      IF SIMDI=ZAMAN THEN PORTC=PORTC & %11111101
      'YER=10
	  Yer=10:Temp=Yer*8:write Temp,255,255,255,255,255,255:pause 10
      gosub ALARM_OKU
      IF SIMDI=ZAMAN THEN PORTC=PORTC & %11111011  
      'YER=11
	  Yer=11:Temp=Yer*8:write Temp,255,255,255,255,255,255:pause 10
      gosub ALARM_OKU
      IF SIMDI=ZAMAN THEN PORTC=PORTC & %11110111
      'YER=12
	  Yer=12:Temp=Yer*8:write Temp,255,255,255,255,255,255:pause 10
      gosub ALARM_OKU
      IF SIMDI=ZAMAN THEN PORTC=PORTC & %11101111
      'YER=13
	  Yer=13:Temp=Yer*8:write Temp,255,255,255,255,255,255:pause 10
      gosub ALARM_OKU
      IF SIMDI=ZAMAN THEN PORTC=PORTC & %11011111
      'YER=14
	  Yer=14:Temp=Yer*8:write Temp,255,255,255,255,255,255:pause 10
      gosub ALARM_OKU

ete

As I told you the yer numbers starting from 1 to 7 are the open alarm numbers. You do not need to use one of them to delete the alarm and you have used Yer=2 this is your mistake.

They Yer numbers 8 to 14 are the close alarm numbers and you have started tou use them Yer=9 and what about Yer=8 ?. This is not deleted and alarms ofcourse continue.
I give you again the numbers.
Yer=1 means alarm nr-1 for opening time , close time of this alarm is Yer=8
Yer=2 means alarm Nr-2 for opening time and closing time this alarm is Yer=9
Yer=3 means alarm Nr-3 for opening time and closing time this alarm is Yer=10
Yer=4 means alarm Nr-4 for opening time and closing time this alarm is Yer=11
Yer=5 means alarm Nr-5 for opening time and closing time this alarm is Yer=12
Yer=6 means alarm Nr-6 for opening time and closing time this alarm is Yer=13
Yer=7 means alarm Nr-7 for opening time and closing time this alarm is Yer=14
thats all.
The codes which I gave you will delete the saved alarms in the eeprom.
Each alarm having and output on PORTC and these outputs are deleted by the lines like,
IF SIMDI=ZAMAN THEN PORTC=PORTC & %11111110  this close the alarm nr-1 You must use also these lines. Do not delete or takeout the lines according to your mind. I just gave you what you add.
The following lines are also importand because they re-save to the eeprom deleted alarms also.
      IF (PORTC=AKTIFA)THEN CIK
      AKTIFA=PORTC
      WRITE 5,AKTIFA:PAUSE 10

Pay attention what I said pls.
Ete

Cesar35

Everything is fine.
I'm actually kind of confused about this.
And how to modify the lines for this to work
thank you for your patience. Thanks, I'll try here

Cesar35

 :( hello my teacher
Thank you for your patience for helping me I confess I'm a little lost in this modification of the code. I think I'm not going right what to do. I apologize for my insistence on this project. Thank you

ete

It was so easy to do that changing. I made for you. I hope it works.

Ete

	'--------------------DESLIGAR O ALARME & PORTC----------------------------------  	     
        YER=8
	GOSUB ALARM_OKU
	IF SIMDI=ZAMAN THEN 
          PORTC=PORTC | %11111110
          GOSUB YAZ
          YER=1:GOSUB YAZ
        ENDIF
          
	YER=9
	GOSUB ALARM_OKU
	IF SIMDI=ZAMAN THEN 
           PORTC=PORTC & %11111101
           GOSUB YAZ
           YER=2:GOSUB YAZ
        ENDIF  
	      
        YER=10
	GOSUB ALARM_OKU
	IF SIMDI=ZAMAN THEN 
           PORTC=PORTC & %11111011  
           GOSUB YAZ
           YER=3:GOSUB YAZ	                
        ENDIF
  
        YER=11  
        GOSUB ALARM_OKU
        IF SIMDI=ZAMAN THEN 
          PORTC=PORTC & %11110111
          GOSUB YAZ
          YER=4:GOSUB YAZ	      
	ENDIF
      
        YER=12
	GOSUB ALARM_OKU
	IF SIMDI=ZAMAN THEN 
           PORTC=PORTC & %11101111
           GOSUB YAZ
           YER=5:GOSUB YAZ
        ENDIF
  	      
        YER=13
        GOSUB ALARM_OKU
	IF SIMDI=ZAMAN THEN 
           PORTC=PORTC & %11011111
           GOSUB YAZ
           YER=6:GOSUB YAZ	      
        ENDIF  
          
        YER=14
	GOSUB ALARM_OKU
	IF SIMDI=ZAMAN THEN 
           PORTC=PORTC & %10111111
           GOSUB YAZ
           YER=1:GOSUB YAZ	      
        ENDIF 

        IF (PORTC=AKTIFA)THEN RETURN
	AKTIFA=PORTC
	WRITE 5,AKTIFA:PAUSE 10
CIK:    RETURN  

YAZ:
     TEMP=YER*8
     WRITE TEMP,255,255,255,255,255:PAUSE 10:RETURN	

Cesar35

hello my teacher
alright.
About the modifications, the information that is recorded in the eeprom and deleted was correct.
The alarm continues to wake up before the programmed time. Examples
I set it to turn on at 4 o'clock in the morning and off at 6 o'clock in the morning.
he calls at 3:15 in the morning
thank you for your help a hug

ete

#39
It is better you put here your program to check it again.
Most probably the problem is the year configuration.
May be it will be better to take out year calculation from compare of the present time and alarm time.

Ete

Cesar35

Thanks again for your help
here is the code




'****************************************************************
'*  Name    : ALARM-SAAT.BAS                                      *
'*  Author  : [Erol Tahir Erdal]                                *
'*  Notice  : Copyright (c) 2005 [ETE]                          *
'*          : All Rights Reserved                               *
'*  Date    : 11.05.2005                                        *
'*  Version : 1.0                                               *
'*  Notes   :                                                   *
'*          :                                                   *
'****************************************************************
#header
  errorlevel -306  ; Crossing page boundry
#ENDHEADER 

#CONFIG
 __config _HS_OSC & _WDT_ON &_PWRTE_ON & _LVP_OFF & _CP_OFF & _BOREN_ON
#ENDCONFIG

'----[Oscillator Setup]---------------------------------------------------------
Define OSC 10  

'------------------------------------------------------------------------------
DEFINE LCD_DREG PORTB      'LCD data bacaklarý hangi porta baðlý? 
DEFINE LCD_DBIT 4          'LCD data bacaklarý hangi bitten baþlýyor? 
DEFINE LCD_EREG PORTB      'LCD Enable Bacaðý Hangi Porta baðlý? 
DEFINE LCD_EBIT 3          'LCD Enable Bacaðý Hangi bite baðlý ? 
DEFINE LCD_RSREG PORTB     'LCD RS Bacaðý Hangi Porta baðlý ? 
DEFINE LCD_RSBIT 2         'LCD RS bacaðý Hangi Bite baðlý ? 
DEFINE LCD_BITS 4          'LCD 4 bit mi yoksa 8 bit olarak baðlý? 
DEFINE LCD_LINES 2         'LCD Kaç sýra yazabiliyor 

'----[Initialize Hardware]------------------------------------------------------
OPTION_REG.7=1    'Dahili pull-up lar iptal edildi
ADCON1 = 7
TRISA = %11111111:PORTA=0
TRISB = %00000000:PORTB=0
TRISC = %00000000:PORTC=0
ADCON1 = 7
'------------------------------------------------------------------------------
SYMBOL SET=PORTA.0
SYMBOL MODE=PORTA.1
SYMBOL DOWN=PORTA.2
SYMBOL UP=PORTA.3
Symbol SCL=PORTB.1
SYMBOL SDA=PORTB.0

SIMDI  VAR  WORD
ZAMAN  VAR  WORD
SN     var  byte
Y_SN   VAR  BYTE
DAK    var  byte
Y_DAK  VAR  BYTE
ESKIDAK VAR BYTE
SAAT   var  byte
Y_SAAT VAR  BYTE
GUN    VAR  BYTE
Y_GUN  VAR  BYTE
HGUN   VAR  BYTE  'HAFTANIN GÜNÜ
Y_HGUN var  byte
AY     var  byte
Y_AY   VAR  BYTE
YIL    var  BYTE
Y_YIL  VAR  BYTE
ESKYIL VAR  BYTE
TAMYIL var  BYTE
TEMP   VAR  BYTE
ARA    VAR  BYTE
ONLAR  VAR  BYTE
BIRLER VAR  BYTE
SURE   VAR  BYTE
SIRA   VAR  BYTE
YER    VAR  BYTE
AKTIFA VAR  BYTE
AKTIFB VAR  BYTE
'------------------------------------------------------------------------------

lcdout $FE,1
PAUSE 200
SURE=180 

READ 0,TAMYIL
IF TAMYIL=255 THEN
TAMYIL=4
WRITE 0,TAMYIL
ENDIF   

READ 2,SIRA
IF SIRA=255 THEN
SIRA=1:WRITE 2,SIRA
ENDIF 
Y_SN=0

rEAD 5,AKTIFA
IF AKTIFA=255 THEN
AKTIFA=0:WRITE 5,AKTIFA:PAUSE 10
ENDIF
'------------------------------------------------------------------------------

BASLA: 
       GOSUB SAAT_OKU
       GOSUB EKRAN
       PAUSE 250
       IF SET=0 THEN AYAR
       IF UP=0 OR DOWN = 0 THEN
       AKTIFA=0:PORTC=0:SIRA=0
       Y_SAAT=0:Y_DAK=0:Y_AY=0:Y_GUN=0:Y_YIL=0    
       FOR YER=1 TO 8
       GOSUB ALARM_KAYIT
       NEXT
       YER=1:WRITE 2,YER:PAUSE 10
       WRITE 5,AKTIFA:PAUSE 10
       ENDIF
       IF (ESKIDAK=DAK) THEN TEKRAR
       ESKIDAK=DAK
       GOSUB ALARM_KONTROL
       PORTC=AKTIFA
TEKRAR:
       GOTO BASLA
       
'-------------------------ALT PROGRAMLAR---------------------------------------
AYAR:  YER=0
       lcdout $FE,$0E
       GOSUB SAAT_OKU
       Y_DAK=DAK
       Y_SAAT=SAAT
       Y_GUN =GUN
       Y_HGUN=HGUN
       Y_AY  =AY
       Y_YIL =YIL
       GOSUB EKRAN1
       WHILE SET=0 
       WEND
       PAUSE SURE

SIRA_BELIRLE:
       IF MODE=0 THEN HOURA
       IF SET=0 THEN SONA
       IF UP=0 THEN
       YER=YER+1
       IF YER=15 THEN YER=14
       ENDIF
       IF DOWN=0 THEN
       YER=YER-1
       IF YER=0 THEN YER=1  'SIRA=0 ÝSE GERÇEK ZAMAN SAATÝ 8583'E KAYIT EDÝLECEK
       ENDIF
       IF YER>0 THEN GOSUB ALARM_OKU
       GOSUB EKRAN1:LCDOUT $FE,$82 'SIRA>0 ÝSE ALARM EEPROME KAYIT EDÝLECEK.
       PAUSE SURE
       GOTO SIRA_BELIRLE
         
HOURA: WHILE MODE=0
       WEND
HOUR:
       IF MODE=0 THEN MINA
       IF SET=0 THEN SONA
       IF UP=0 THEN
       Y_SAAT=Y_SAAT+1
       IF Y_SAAT=24 THEN Y_SAAT=0
       ENDIF        
       
       IF DOWN=0 THEN
       Y_SAAT=Y_SAAT-1
       IF Y_SAAT=255 THEN Y_SAAT=23
       ENDIF
       GOSUB EKRAN1:LCDOUT $FE,$86
       PAUSE SURE
       GOTO HOUR

MINA:  WHILE MODE=0
       WEND
             
MINUTE:IF MODE=0 THEN TAKA
       IF SET=0 THEN SONA
       IF UP=0 THEN
       Y_DAK=Y_DAK+1    
       IF Y_DAK=60 THEN  Y_DAK=0
       ENDIF 
       IF DOWN=0 THEN
       Y_DAK=Y_DAK-1
       IF Y_DAK=255 THEN Y_DAK=59
       ENDIF 
       GOSUB EKRAN1:LCDOUT $FE,$89
       PAUSE SURE
       GOTO MINUTE 

TAKA:  WHILE MODE=0
       WEND
TAKVIM:
       IF MODE=0 THEN AYA
       IF SET=0 THEN SONA
       IF UP=0 THEN
       Y_GUN=Y_GUN+1    
       IF Y_GUN=32 THEN  Y_GUN=1
       ENDIF            
       IF DOWN=0 THEN
       Y_GUN=Y_GUN-1    
       IF Y_GUN=0 THEN  Y_GUN=31
       ENDIF 
       GOSUB EKRAN1:LCDOUT $FE,$C1
       PAUSE SURE 
       GOTO TAKVIM

AYA:   WHILE MODE=0
       WEND
MONTH:       
       IF MODE=0 THEN YILA
       IF SET=0 THEN SONA
       IF UP=0 THEN
       Y_AY=Y_AY+1    
       IF Y_AY=13 THEN  Y_AY=1
       ENDIF            
       IF DOWN=0 THEN
       Y_AY=Y_AY-1    
       IF Y_AY=0 THEN  Y_AY=12
       ENDIF 
       GOSUB EKRAN1:LCDOUT $FE,$C4
       PAUSE SURE 
       GOTO MONTH

YILA:  WHILE MODE=0
       WEND
YEAR:  IF MODE=0 THEN GUNA
       IF SET=0 THEN SONA
       IF UP=0 THEN
       Y_YIL=Y_YIL+1    
       IF Y_YIL=100 THEN  Y_YIL=0
       ENDIF            
       IF DOWN=0 THEN
       Y_YIL=Y_YIL-1    
       IF Y_YIL=0 THEN  Y_YIL=99
       ENDIF 
       GOSUB EKRAN1:LCDOUT $FE,$C7
       PAUSE SURE 
       GOTO YEAR

GUNA: WHILE MODE=0
      WEND
HAFGUN:IF MODE=0 THEN SONA
       IF SET=0 THEN SONA
       IF UP=0 THEN
       Y_HGUN=Y_HGUN+1    
       IF Y_HGUN=7 THEN  Y_HGUN=0
       ENDIF            
       IF DOWN=0 THEN
       Y_HGUN=Y_HGUN-1    
       IF Y_HGUN=255 THEN  Y_HGUN=6
       ENDIF 
       GOSUB EKRAN1:LCDOUT $FE,$CA
       PAUSE SURE 
       GOTO HAFGUN

SONA:IF YER=0 THEN KAYIT
       GOSUB ALARM_KAYIT
       GOTO BASLA     
'-------------------------------------------------------------------------------
EKRAN: LCDOUT $FE,2,"     "
       LCDOUT DEC2(SAAT),":",DEC2(DAK),":", dec2(SN)
       LCDOUT $FE,192,dec2(GUN),"/",dec2(AY),"/",dec2(YIL+TAMYIL)
       LCDOUT $FE,$CE,"A" 
       ARA=HGUN 
DORT:  select case ARA
       case 0
       lcdout $fe,$c9,"DOM "
       case 1
       lcdout $fe,$c9,"SEG "                          
       case 2
       lcdout $fe,$c9,"TER "
       case 3
       lcdout $fe,$c9,"QUA "
       case 4
       lcdout $fe,$c9,"QUI "
       case 5
       lcdout $fe,$c9,"SEX "
       case 6
       lcdout $fe,$c9,"SAB"
       end select      
       RETURN       

EKRAN1: 'BU EKRAN SAAT AYARINDA KULLANILAN ÝLK EKRAN
       LCDOUT $FE,$0C,$FE,2,"[",dec2 YER,"] "
       LCDOUT DEC2(Y_SAAT),":",DEC2(Y_DAK),":", DEC2(SN)
       LCDOUT $FE,192,dec2(Y_GUN),"/",dec2(Y_AY),"/",dec2(Y_YIL+TAMYIL) ,$FE,$0E
       ARA=Y_HGUN
       GOTO DORT

'-------------------------------------------------------------------------------
KAYIT:WHILE set=0
      wend     
      LCDOUT $FE,$0C     'REG_2  'SEGUNDO <0:5>
      TEMP=Y_YIL+TAMYIL  'REG_3  'MINUTO  <0:5>
      TAMYIL=4*(TEMP/4 ) 'REG_4  'HORA    <0:5>
      Y_YIL=TEMP-TAMYIL  'REG_5  'DIA     <0:5> ' YIL  <6:7>  
      WRITE 0,TAMYIL     'REG_6  'MES     <0:4> ' DIA DA SEMANA<5:7>       
                                                             
DAKHESAP:
      TEMP=Y_DAK:GOSUB HESAP
      Y_DAK=ONLAR+BIRLER
      
SAATHESAP:
      TEMP=Y_SAAT:GOSUB HESAP
      Y_SAAT=ONLAR+BIRLER
      IF TEMP>12 THEN Y_SAAT.6=1
      
GUNHESAP:
      TEMP=Y_GUN:GOSUB HESAP
      Y_YIL=Y_YIL<<6
      Y_GUN=Y_YIL+ONLAR+BIRLER
       
AYHESAP:
      TEMP=Y_AY:GOSUB HESAP
      Y_HGUN=Y_HGUN<<5
      Y_AY=Y_HGUN + ONLAR + BIRLER
                          
      I2CWRITE SDA,SCL,160,2,[Y_SN,Y_DAK,Y_SAAT,Y_GUN,Y_AY]
      GOSUB SAAT_OKU 
      lcdout $fe,1
      GOTO BASLA
HESAP:
      ARA=(TEMP/10)
      ONLAR=ARA<<4
      BIRLER=TEMP-(ara*10)
      RETURN
'-------------------------------------------------------------------------------      
SAAT_OKU:ESKYIL=YIL
      I2CREAD SDA,SCL,161,2,[SN,DAK,SAAT,GUN,AY]
      YIL.1=GUN.7
      YIL.0=GUN.6
      IF ESKYIL=3 AND YIL=0 THEN
      TAMYIL=TAMYIL+4
      WRITE 0,TAMYIL
      ENDIF   
      TEMP=AY
      HGUN=TEMP>>5
      SN=SN&%00111111
      TEMP=DAK:gosub BUL:DAK=TEMP
      TEMP=SAAT&%00111111:GOSUB BUL:SAAT=TEMP
      TEMP=GUN&%00111111:GOSUB CEVIR:GUN=TEMP
      TEMP=AY&%00011111:GOSUB IKI:AY=TEMP
      RETURN 

CEVIR:
      ONLAR=TEMP & 48
UC:   ONLAR=(onlar>>4)*10          
BIR:  BIRLER=TEMP & %1111
      TEMP=ONLAR+BIRLER
      RETURN
BUL:ONLAR=(TEMP>>4)*10
      GOTO BIR      
IKI:  ONLAR=ay & 16      
      GOTO UC
'------------------LIGAR O ALARME & PORTC---------------------------------------
ALARM_KONTROL:  
      SIMDI=YIL+AY+GUN+SAAT+DAK
      YER=1
      GOSUB ALARM_OKU
      IF SIMDI=ZAMAN THEN PORTC=PORTC | %00000001  
      YER=2
      gosub ALARM_OKU
      IF SIMDI=ZAMAN THEN PORTC=PORTC | %00000010 
      YER=3   
      gosub ALARM_OKU
      IF SIMDI=ZAMAN THEN PORTC=PORTC | %00000100
      YER=4
      gosub ALARM_OKU
      IF SIMDI=ZAMAN THEN PORTC=PORTC | %00001000
      YER=5
      gosub ALARM_OKU
      IF SIMDI=ZAMAN THEN PORTC=PORTC | %00010000
      YER=6
      gosub ALARM_OKU
      IF SIMDI=ZAMAN THEN PORTC=PORTC | %00100000
      YER=7
      gosub ALARM_OKU
      IF SIMDI=ZAMAN THEN PORTC=PORTC | %01000000 

'--------------------DESLIGAR O ALARME & PORTC---------------------------------- 
      YER=8
      GOSUB ALARM_OKU
      IF SIMDI=ZAMAN THEN 
      PORTC=PORTC & %11111110
      GOSUB YAZ
      YER=1:GOSUB YAZ
      ENDIF       
      
      YER=9
      GOSUB ALARM_OKU
      IF SIMDI=ZAMAN THEN 
      PORTC=PORTC & %11111110
      GOSUB YAZ
      YER=2:GOSUB YAZ
      ENDIF       
      
      YER=10
      GOSUB ALARM_OKU
      IF SIMDI=ZAMAN THEN 
      PORTC=PORTC & %11111110
      GOSUB YAZ
      YER=3:GOSUB YAZ
      ENDIF       
      
      YER=11
      GOSUB ALARM_OKU
      IF SIMDI=ZAMAN THEN 
      PORTC=PORTC & %11111110
      GOSUB YAZ
      YER=4:GOSUB YAZ
      ENDIF       
      
      YER=12
      GOSUB ALARM_OKU
      IF SIMDI=ZAMAN THEN 
      PORTC=PORTC & %11111110
      GOSUB YAZ
      YER=5:GOSUB YAZ
      ENDIF       
      
      YER=13
      GOSUB ALARM_OKU
      IF SIMDI=ZAMAN THEN 
      PORTC=PORTC & %11111110
      GOSUB YAZ
      YER=6:GOSUB YAZ
      ENDIF       
      
      YER=14
      GOSUB ALARM_OKU
      IF SIMDI=ZAMAN THEN 
      PORTC=PORTC & %11111110
      GOSUB YAZ
      YER=7:GOSUB YAZ
      ENDIF       
      IF (PORTC=AKTIFA)THEN CIK
      AKTIFA=PORTC
      WRITE 5,AKTIFA:PAUSE 10
CIK:  RETURN

YAZ:
      TEMP=YER*8
      WRITE Temp,255,255,255,255,255,255:pause 10:RETURN	
    
ALARM_KAYIT:
      IF YER>SIRA THEN
      WRITE 2,YER:PAUSE 10
      ENDIF
      temp=yer*8 
      WRITE TEMP,Y_SAAT:PAUSE 10
      WRITE TEMP+1,Y_DAK:PAUSE 10
      WRITE TEMP+2,Y_GUN:PAUSE 10
      WRITE TEMP+3,Y_AY :PAUSE 10
      WRITE TEMP+4,Y_YIL:PAUSE 10
      RETURN

ALARM_OKU:
      temp=yer*8
      READ TEMP,Y_SAAT:IF Y_SAAT>23 THEN Y_sAAT=0
      READ TEMP+1,Y_DAK:IF Y_DAK>59 THEN Y_DAK=0
      READ TEMP+2,Y_GUN:IF Y_GUN>31 THEN y_GUN=1
      READ TEMP+3,Y_AY :IF Y_AY>12 THEN Y_AY=1
      READ TEMP+4,Y_YIL:IF Y_YIL>99 THEN Y_YIL=0
      ZAMAN=Y_YIL+Y_AY+Y_GUN+Y_SAAT+Y_DAK
      RETURN
      end
  

ete

Try enclosed program. Do not change any place pls.
Ete

Cesar35

Hello teacher
Alarm clock report
At 7:00 I set it to turn on at 5:00 in the morning and off at 6:00 in the morning.
At 10:00 o'clock at night I went to check the alarms were all deleted eeprom.
thank you for helping me
A hug

ete

Still there was small errors on that program.
I made some more corrections and the enclosed program is better than the previous one.
Use this one.
Ete

Cesar35

Hello Ete
about the last
Program
if it is adjusted, the alarm does not adjust, it stays with the same time as the alarm and the same as the time
I think the problem is this code that is missing.
YER=YER-1    
       IF YER=0 THEN YER=1  'SIRA=0 ÝSE GERÇEK ZAMAN SAATÝ 8583'E KAYIT EDÝLECEK
       ENDIF
       IF YER>0 THEN GOSUB ALARM_OKU ???????????????????
       GOSUB EKRAN1:LCDOUT $FE,$82 'O PRÓXIMO >0 É ALARME EEPROME SERÁ REGISTRADO.
       PAUSE SURE
       GOTO SIRA_BELIRLE
This line here in the new program doesn't have .
It stays at the same time as the alarm and the non-adjustable time.
It's giving problem here too.

HOURA: WHILE MODE=0:WEND
       IF YER>0 THEN 
         GOSUB ALARM_OKU 
         IF Y_SAAT=0 AND Y_DAK=0 AND Y_GUN=0 THEN
            Y_SAAT=SAAT:Y_DAK=DAK:Y_GUN=GUN:Y_AY=AY:Y_HGUN=HGUN:Y_YIL=YIL
         ENDIF
       ENDIF      

This line is also having a problem when adjusting
When I press the button to adjust the time it skips the year digit
thanks again for the help with this project

Powered by EzPortal