Satır Taramalı Kayan Yazı

Başlatan meyer, 18 Aralık 2011, 15:01:38

ete

Kodlara bakıp bir şey anlamak çok vakit alan bir iş.
Sen neden ilk programı eline alıp dizi değişkenlerine harf datalarını eşitlediğin kısma LOOKUP tablosundan data lıp eşitleme işini yaptırmadın?.
İşlemleri bir birinin içine sokarsan sonra içinden çıkımaz hale gelir.

Gün içinde boş zaman bulursam kodlarada bakacağım.

Ete

meyer

#16
 Hocam sanıyorum bu şekilde yapmamın daha doğru olacağını söylediniz..Haklısınız hocam devreyi bu şekilde yaparsam daha kolay bir şekilde yapabilirim.
Hocam bir de kodları incelemenize gerek yok..Kodlarda bir hatamı  gördüm..Lookup'ın içine "ABCDE" yazınca bütün alfabe kayıyor demiştim..Meğer her matrix kendi içinde,kendinden sonraki harfi getirerek kaydırma yapıyormuş..Lookup'ın içeriğini değiştirdiğimde farkettim.
Kodlarıda en kısa zamanda aşağıdaki şekle uyarlayıp paylaşırım hocam..
İlginiz için teşekkür ederim.İyi günler...


data_sec:
Select Case harf_reg
Case "H"
SUTUN[0]=%11111111
SUTUN[1]=%10000000
SUTUN[2]=%11110111
SUTUN[3]=%11110111
SUTUN[4]=%11110111
SUTUN[5]=%11110111
SUTUN[6]=%10000000
SUTUN[7]=%11111111
return
case "A"
....
...
...
..
return
end select

meyer

#17
  İyi günler Ete Hocam,
Harfleri lookup'dan çekip ekrana bastıktan sonra sağa,sola,aşağı ve yukarı doğru  kaydırabildim..Bir önceki mesajımdaki gibi çok uğraştım hocam ama bir türlü o şekilde kaydırma işini yapamadım.Mantık eksikliğinden dolayı olsa gerek..Bende bu şekilde yapmaya karar verdim...


'****************************************************************
'*  Name    : UNTITLED.BAS                                      *
'*  Author  : [select VIEW...EDITOR OPTIONS]                    *
'*  Notice  : Copyright (c) 2011 [select VIEW...EDITOR OPTIONS] *
'*          : All Rights Reserved                               *
'*  Date    : 23.12.2011                                        *
'*  Version : 1.0                                               *
'*  Notes   :                                                   *
'*          :                                                   *
'****************************************************************
define OSC 20
'****************************************************************
TRISB=0 : TRISD=0  : TRISA=0 : TRISC=0 : TRISE=0
PORTB=0 : PORTD=0  : PORTA=0 : PORTC=0 : PORTE=0
INTCON2.7=0
'74HC595*********************************************************
Symbol CLK1   =PORTB.0
Symbol DTA1   =PORTB.1
Symbol STROBE1=PORTB.2
'****************************************************************
SUTUN     var Byte[8]   ' 1497 adet byte tipinde değişken tanımlanabilir.
ARA       VAR BYTE
I         var Byte
X         var Byte
W         var Byte
M         var BYTE
'''''''''''''''''''
yazi_reg  var byte
harf_reg  var byte
z         var byte
y         var byte
t         VAR BYTE
clear
pause 250
'****************************************************************
BASLA:
yazi_reg=0 
    For W=0 To 4
gosub yazi : yazi_Reg=yazi_reg+1
gosub data_al
aa:
      X=1
      For I=0 To 7
SHiftOut DTA1,CLK1,1,[SUTUN[I+32],SUTUN[I+24],SUTUN[I+16],SUTUN[I+8],SUTUN[I]]
        PORTD=X
        High STROBE1 : pauseus 200 : Low STROBE1
        X=X*2
        pause 3
      Next
     Next
    pause 1

M=M+1

If M<40           Then gosub sola_kay   : goto aa 
If M>40 and m<80  Then gosub saga_kay   : goto aa
If M>80 and m<89  Then gosub asagi_kay  : goto aa
if m>89 and m<98  then gosub yukari_kay : goto aa
If m>98 then m=0

goto basla
'****************************************************************
yazi:
LookUp yazi_reg,["HAKAN"],harf_reg
Return
'****************************************************************
sola_kay:
For I=0 To 38
    sutun[i]= sutun[i+1]
   If i=39 Then sutun[39]=sutun[0]
Next i
pauseus 10000
return
'****************************************************************
saga_kay:
For I=38 to 0 step -1
    sutun[i]= sutun[i-1]
   If i=0 Then sutun[0]=sutun[39]
Next i
pauseus 10000
return
'****************************************************************
asagi_kay:
for I=0 to 39
   ARA=SUTUN[I]
   z=ARA.7
FOR X=7 to 1 STEP -1
   ARA.0[x]=ARA.0[X-1]
NEXT
   ara.0=Z
   sutun[I]=ARA
next
pauseus 10000
Return
'****************************************************************
yukari_kay:
FOR I=0 to 39
   ARA=SUTUN[I]
   z=ARA.0
FOR X=0 to 6
   ARA.0[X]=ARA.0[X+1]
NEXT
   ARA.7=Z
   SUTUN[I]=ARA
NEXT
pauseus 10000
Return
'****************************************************************
data_al:
Select Case harf_reg
i=0
if w=1 then  I=I+8 
if w=2 then  I=i+16
if w=3 then  I=i+24
if w=4 then  I=i+32
'''''''''''''''''''
Case "A"
for t=0 to 7
lookup t,[$FF,$81,$F6,$F6,$F6,$F6,$81,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "B"
for t=0 to 7
lookup t,[$FF,$80,$B6,$B6,$B6,$B6,$C9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "C"
for t=0 to 7
lookup t,[$FF,$C1,$BE,$BE,$BE,$BE,$DD,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "D"
for t=0 to 7
lookup t,[ $FF,$80,$BE,$BE,$BE,$BE,$C1,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "E" 
for t=0 to 7
lookup t,[$FF,$80,$B6,$B6,$B6,$B6,$BE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "F"
for t=0 to 7
lookup t,[ $FF,$80,$F6,$F6,$F6,$F6,$FE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "G"
for t=0 to 7
lookup t,[$FF,$80,$BE,$B6,$B6,$B6,$86,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "H"
for t=0 to 7
lookup t,[$FF,$80,$F7,$F7,$F7,$F7,$80,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "I"
for t=0 to 7
lookup t,[$FF,$BE,$BE,$80,$80,$BE,$BE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
case "J"
for t=0 to 7
lookup t,[$FF,$CE,$BE,$80,$80,$FE,$FF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "K"
for t=0 to 7
lookup t,[$FF,$80,$F7,$EB,$DD,$BE,$FF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "L"
for t=0 to 7
lookup t,[$FF,$80,$BF,$BF,$BF,$BF,$BF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''                       
Case "M"
for t=0 to 7
lookup t,[$FF,$80,$FB,$F7,$F7,$FB,$80,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "N" 
for t=0 to 7
lookup t,[$FF,$80,$FB,$F7,$EF,$DF,$80,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "O"
for t=0 to 7
lookup t,[$FF,$C1,$BE,$BE,$BE,$BE,$C1,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "P"
for t=0 to 7
lookup t,[$FF,$80,$F6,$F6,$F6,$F6,$F9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "R"
for t=0 to 7
lookup t,[$FF,$80,$F6,$E6,$D6,$B6,$B9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "S"
for t=0 to 7
lookup t,[$FF,$D9,$B6,$B6,$B6,$B6,$CD,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "T"
for t=0 to 7
lookup t,[$FF,$FE,$FE,$80,$80,$FE,$FE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "U"                               
for t=0 to 7
lookup t,[$FF,$C0,$BF,$BF,$BF,$BF,$C0,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "V" 
for t=0 to 7
lookup t,[$FF,$E0,$DF,$BF,$BF,$DF,$E0,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "Y"
for t=0 to 7
lookup t,[$FF,$FC,$FB,$87,$87,$FB,$FC,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "Z"
for t=0 to 7
lookup t,[$FF,$9E,$AE,$B6,$BA,$BC,$BE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case " "
for t=0 to 7
lookup t,[$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
End Select
Return

End


meyer

  İyi akşamlar Ete Hocam,
Projenin 8*80 halini yaptım..Hocam harfleri ekrana basarken biraz yavaş kalıyor gibi ama gecikmelerle oynanarak düzeltilebilir diye düşünüyorum..Devre şemasını,pbp kodunu ve .hex kodunu da ekte yolluyorum..


'****************************************************************
'*  Name    : UNTITLED.BAS                                      *
'*  Author  : [select VIEW...EDITOR OPTIONS]                    *
'*  Notice  : Copyright (c) 2011 [select VIEW...EDITOR OPTIONS] *
'*          : All Rights Reserved                               *
'*  Date    : 23.12.2011                                        *
'*  Version : 1.0                                               *
'*  Notes   :                                                   *
'*          :                                                   *
'****************************************************************
define OSC 20
'****************************************************************
TRISB=0 : TRISD=0  : TRISA=0 : TRISC=0 : TRISE=0
PORTB=0 : PORTD=0  : PORTA=0 : PORTC=0 : PORTE=0
INTCON2.7=0
'74HC595*********************************************************
Symbol CLK1   =PORTB.0
Symbol DTA1   =PORTB.1
Symbol STROBE1=PORTB.2
'****************************************************************
SUTUN     var Byte[8]   ' 1497 adet byte tipinde değişken tanımlanabilir.
ARA       VAR BYTE
I         var Byte
X         var Byte
W         var Byte
M         var BYTE
'''''''''''''''''''
yazi_reg  var byte
harf_reg  var byte
z         var byte
y         var byte
t         VAR BYTE
clear
pause 250
'****************************************************************
BASLA:
yazi_reg=0 
    For W=0 To 9
gosub yazi : yazi_Reg=yazi_reg+1
gosub data_al
aa:
      X=1
      For I=0 To 7
SHiftOut DTA1,CLK1,1,[SUTUN[I+72],SUTUN[I+64],SUTUN[I+56],SUTUN[I+48],SUTUN[I+40],_
SUTUN[I+32],SUTUN[I+24],SUTUN[I+16],SUTUN[I+8],SUTUN[I]]
        PORTD=X
        High STROBE1 : pauseus 200 : Low STROBE1
        X=X*2
        pause 3
      Next
     Next
    pause 1
M=M+1

If M<80               Then gosub sola_kay   : goto aa 
If M>80   and m<160   Then gosub saga_kay   : goto aa
If M>160  and m<169   Then gosub asagi_kay  : goto aa
if m>169  and m<178   then gosub yukari_kay : goto aa
If m>178 then m=0

goto basla
'****************************************************************
yazi:
LookUp yazi_reg,["ELEKTRONIK"],harf_reg
Return
'****************************************************************
sola_kay:
For I=0 To 78
    sutun[i]= sutun[i+1]
   If i=79 Then sutun[79]=sutun[0]
Next i
pauseus 10000
return
'****************************************************************
saga_kay:
For I=78 to 0 step -1
    sutun[i]= sutun[i-1]
   If i=0 Then sutun[0]=sutun[79]
Next i
pauseus 10000
return
'****************************************************************
asagi_kay:
for I=0 to 79
   ARA=SUTUN[I]
   z=ARA.7
FOR X=7 to 1 STEP -1
   ARA.0[x]=ARA.0[X-1]
NEXT
   ara.0=Z
   sutun[I]=ARA
next
pauseus 10000
Return
'****************************************************************
yukari_kay:
FOR I=0 to 79
   ARA=SUTUN[I]
   z=ARA.0
FOR X=0 to 6
   ARA.0[X]=ARA.0[X+1]
NEXT
   ARA.7=Z
   SUTUN[I]=ARA
NEXT
pauseus 10000
Return
'****************************************************************
data_al:
Select Case harf_reg
i=0
if w=1 then  I=I+8 
if w=2 then  I=i+16
if w=3 then  I=i+24
if w=4 then  I=i+32
if w=5 then  I=i+40
if w=6 then  I=i+48
if w=7 then  I=i+56
if w=8 then  I=i+64
if w=9 then  I=i+72
'''''''''''''''''''
Case "A"
for t=0 to 7
lookup t,[$FF,$81,$F6,$F6,$F6,$F6,$81,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "B"
for t=0 to 7
lookup t,[$FF,$80,$B6,$B6,$B6,$B6,$C9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "C"
for t=0 to 7
lookup t,[$FF,$C1,$BE,$BE,$BE,$BE,$DD,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "D"
for t=0 to 7
lookup t,[ $FF,$80,$BE,$BE,$BE,$BE,$C1,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "E"
for t=0 to 7
lookup t,[$FF,$80,$B6,$B6,$B6,$B6,$BE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "F"
for t=0 to 7
lookup t,[ $FF,$80,$F6,$F6,$F6,$F6,$FE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "G"
for t=0 to 7
lookup t,[$FF,$80,$BE,$B6,$B6,$B6,$86,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "H"
for t=0 to 7
lookup t,[$FF,$80,$F7,$F7,$F7,$F7,$80,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "I"
for t=0 to 7
lookup t,[$FF,$BE,$BE,$80,$80,$BE,$BE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
case "J"
for t=0 to 7
lookup t,[$FF,$CE,$BE,$80,$80,$FE,$FF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "K"
for t=0 to 7
lookup t,[$FF,$80,$F7,$EB,$DD,$BE,$FF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "L"
for t=0 to 7
lookup t,[$FF,$80,$BF,$BF,$BF,$BF,$BF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''                       
Case "M"
for t=0 to 7
lookup t,[$FF,$80,$FB,$F7,$F7,$FB,$80,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "N" 
for t=0 to 7
lookup t,[$FF,$80,$FB,$F7,$EF,$DF,$80,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "O"
for t=0 to 7
lookup t,[$FF,$C1,$BE,$BE,$BE,$BE,$C1,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "P"
for t=0 to 7
lookup t,[$FF,$80,$F6,$F6,$F6,$F6,$F9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "R"
for t=0 to 7
lookup t,[$FF,$80,$F6,$E6,$D6,$B6,$B9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "S"
for t=0 to 7
lookup t,[$FF,$D9,$B6,$B6,$B6,$B6,$CD,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "T"
for t=0 to 7
lookup t,[$FF,$FE,$FE,$80,$80,$FE,$FE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "U"                               
for t=0 to 7
lookup t,[$FF,$C0,$BF,$BF,$BF,$BF,$C0,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "V" 
for t=0 to 7
lookup t,[$FF,$E0,$DF,$BF,$BF,$DF,$E0,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "Y"
for t=0 to 7
lookup t,[$FF,$FC,$FB,$87,$87,$FB,$FC,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "Z"
for t=0 to 7
lookup t,[$FF,$9E,$AE,$B6,$BA,$BC,$BE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case " "
for t=0 to 7
lookup t,[$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
End Select
Return

End



ete

Hızlı bir makinada programın çalışması hiçde yavaş gözükmüyor. Bence normal.
İyi gidiyorsun.

KOlay Gelsin
Ete

meyer


meyer

    İyi akşamlar arkadaşlar,
Bu sefer de projenin 8*160'lık halini yaptım.Sanıyorum ki bu şekilde projenin uzunluğu  istenildiği kadar arttırılabilir.Bundan fazlası benim bilgisayarımda sıkıntı yaratıyor ama gerçekte de böyle mi olur bilemiyorum...
Bundan sonrada devremize saat-sıcaklık-tarih-gün bilgisini eklemeye çalışacağım..Yapabilirsem eğer en kısa sürede paylaşırım...
 

'****************************************************************
'*  Name    : UNTITLED.BAS                                      *
'*  Author  : [select VIEW...EDITOR OPTIONS]                    *
'*  Notice  : Copyright (c) 2011 [select VIEW...EDITOR OPTIONS] *
'*          : All Rights Reserved                               *
'*  Date    : 23.12.2011                                        *
'*  Version : 1.0                                               *
'*  Notes   :                                                   *
'*          :                                                   *
'****************************************************************
define OSC 20
'****************************************************************
TRISB=0 : TRISD=0  : TRISA=0 : TRISC=0 : TRISE=0
PORTB=0 : PORTD=0  : PORTA=0 : PORTC=0 : PORTE=0
INTCON2.7=0
'74HC595*********************************************************
Symbol CLK1   =PORTB.0
Symbol DTA1   =PORTB.1
Symbol STROBE1=PORTB.2
'****************************************************************
SUTUN     var Byte[8]   ' 1497 adet byte tipinde değişken tanımlanabilir.
ARA       VAR BYTE
I         var Byte
X         var Byte
W         var Byte
M         var WORD
'''''''''''''''''''
yazi_reg  var byte
harf_reg  var byte
z         var byte
y         var byte
t         VAR BYTE
clear
pause 250
'****************************************************************
BASLA:
yazi_reg=0 
    For W=0 To 19
gosub yazi : yazi_Reg=yazi_reg+1
gosub data_al
aa:
      X=1
      For I=0 To 7
SHiftOut DTA1,CLK1,1,[SUTUN[I+152],SUTUN[I+144],SUTUN[I+136],_
SUTUN[I+128],SUTUN[I+120],SUTUN[I+112],SUTUN[I+104],_
  SUTUN[I+96],SUTUN[I+88],SUTUN[I+80],SUTUN[I+72],_
   SUTUN[I+64],SUTUN[I+56],SUTUN[I+48],SUTUN[I+40],_
    SUTUN[I+32],SUTUN[I+24],SUTUN[I+16],SUTUN[I+8],SUTUN[I]]
        PORTD=X
        High STROBE1 : pauseus 200 : Low STROBE1
        X=X*2
        pause 3
      Next
     Next
    pause 1
M=M+1
If M<160              Then gosub sola_kay   : goto aa 
If M>160  and m<320  Then gosub saga_kay   : goto aa
If M>320  and m<329   Then gosub asagi_kay  : goto aa
if m>329  and m<338   then gosub yukari_kay : goto aa
If m>338  then m=0

goto basla
'****************************************************************
yazi:
LookUp yazi_reg,["KAYANYAZI DENEMELERi"],harf_reg
Return
'****************************************************************
sola_kay:
For I=0 To 158
    sutun[i]= sutun[i+1]
   If i=159 Then sutun[159]=sutun[0]
Next i
'pauseus 10000
pauseus 5000
return
'****************************************************************
saga_kay:
For I=158 to 0 step -1
    sutun[i]= sutun[i-1]
   If i=0 Then sutun[0]=sutun[159]
Next i
'pauseus 10000
pauseus 5000
return
'****************************************************************
asagi_kay:
for I=0 to 159
   ARA=SUTUN[I]
   z=ARA.7
FOR X=7 to 1 STEP -1
   ARA.0[x]=ARA.0[X-1]
NEXT
   ara.0=Z
   sutun[I]=ARA
next
'pauseus 10000
pauseus 5000
Return
'****************************************************************
yukari_kay:
FOR I=0 to 159
   ARA=SUTUN[I]
   z=ARA.0
FOR X=0 to 6
   ARA.0[X]=ARA.0[X+1]
NEXT
   ARA.7=Z
   SUTUN[I]=ARA
NEXT
'pauseus 10000
pauseus 5000
Return
'****************************************************************
data_al:
Select Case harf_reg
i=0
if w=1  then  I=I+8 
if w=2  then  I=i+16
if w=3  then  I=i+24
if w=4  then  I=i+32
if w=5  then  I=i+40
if w=6  then  I=i+48
if w=7  then  I=i+56
if w=8  then  I=i+64
if w=9  then  I=i+72
if w=10 then  I=i+80
if w=11 then  I=i+88
if w=12 then  I=i+96
if w=13 then  I=i+104
if w=14 then  I=i+112
if w=15 then  I=i+120
if w=16 then  I=i+128
if w=17 then  I=i+136
if w=18 then  I=i+144
if w=19 then  I=i+152
'''''''''''''''''''
Case "A"
for t=0 to 7
lookup t,[$FF,$81,$F6,$F6,$F6,$F6,$81,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "B"
for t=0 to 7
lookup t,[$FF,$80,$B6,$B6,$B6,$B6,$C9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "C"
for t=0 to 7
lookup t,[$FF,$C1,$BE,$BE,$BE,$BE,$DD,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "D"
for t=0 to 7
lookup t,[ $FF,$80,$BE,$BE,$BE,$BE,$C1,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "E"
for t=0 to 7
lookup t,[$FF,$80,$B6,$B6,$B6,$B6,$BE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "F"
for t=0 to 7
lookup t,[ $FF,$80,$F6,$F6,$F6,$F6,$FE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "G"
for t=0 to 7
lookup t,[$FF,$80,$BE,$B6,$B6,$B6,$86,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "H"
for t=0 to 7
lookup t,[$FF,$80,$F7,$F7,$F7,$F7,$80,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "I"
for t=0 to 7
lookup t,[$FF,$BE,$BE,$80,$80,$BE,$BE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "i"
for t=0 to 7
lookup t,[$FF,$BF,$BB,$82,$82,$BB,$BF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
case "J"
for t=0 to 7
lookup t,[$FF,$CE,$BE,$80,$80,$FE,$FE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "K"
for t=0 to 7
lookup t,[$FF,$80,$F7,$EB,$DD,$BE,$FF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "L"
for t=0 to 7
lookup t,[$FF,$80,$BF,$BF,$BF,$BF,$BF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''                       
Case "M"
for t=0 to 7
lookup t,[$FF,$80,$FB,$F7,$F7,$FB,$80,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "N" 
for t=0 to 7
lookup t,[$FF,$80,$FB,$F7,$EF,$DF,$80,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "O"
for t=0 to 7
lookup t,[$FF,$C1,$BE,$BE,$BE,$BE,$C1,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "P"
for t=0 to 7
lookup t,[$FF,$80,$F6,$F6,$F6,$F6,$F9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "R"
for t=0 to 7
lookup t,[$FF,$80,$F6,$E6,$D6,$B6,$B9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "S"
for t=0 to 7
lookup t,[$FF,$D9,$B6,$B6,$B6,$B6,$CD,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "T"
for t=0 to 7
lookup t,[$FF,$FE,$FE,$80,$80,$FE,$FE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "U"                               
for t=0 to 7
lookup t,[$FF,$C0,$BF,$BF,$BF,$BF,$C0,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "V" 
for t=0 to 7
lookup t,[$FF,$E0,$DF,$BF,$BF,$DF,$E0,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "Y"
for t=0 to 7
lookup t,[$FF,$FC,$FB,$87,$87,$FB,$FC,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "Z"
for t=0 to 7
lookup t,[$FF,$9E,$AE,$B6,$BA,$BC,$BE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case " "
for t=0 to 7
lookup t,[$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
End Select
Return

End




meyer

#22
  İyi akşamlar arkadaşlar,
Bu sefer de 8*96 sutun matrix kayan yazı ve sırasıyla matrix panoda saat,sıcaklık,tarih ve gün bilgisini gösteren devreyi paylaşıyorum..Devrenin şimdilik 1-2 eksiği var,veya  daha fazla..Onlarıda yapabilirsem eğer harf datalarını eeproma kaydetmeye çalışacağım..
Devrenin pbp kodunu,isis devre şemasını ve hex kodunu da ekte yolluyorum arkadaşlar..


'****************************************************************
'*  Name    : MATRIX_PANO_SAAT_ISI_TARIH_GUN_KAYAN_YAZI.BAS     *
'*  Author  : [HAKAN_ÖZKAN]                                     *
'*  Notice  : Copyright (c) 2011 [select VIEW...EDITOR OPTIONS] *
'*          : All Rights Reserved                               *
'*  Date    : 24.12.2011                                        *
'*  Version : 1.0                                               *
'*  Notes   :                                                   *
'*          :                                                   *
'****************************************************************
define OSC 20
'****************************************************************
TRISB=0 : TRISD=0  : TRISC=%00000111 : TRISE=0 : TRISA=0
PORTB=0 : PORTD=0  : PORTC=0 : PORTE=0 : PORTA=0
INTCON2.7=0
'74HC595*********************************************************
Symbol CLK1     =PORTB.0
Symbol DTA1     =PORTB.1
Symbol STROBE1  =PORTB.2
'DS18B20*********************************************************
SYMBOL COMM_PIN =PORTB.3
'DS1302**********************************************************
symbol  RTC_RST =PORTB.5         'RTC nin bağlandığı portlar
symbol  RTC_SCLK=PORTB.6
symbol  RTC_DTA =PORTB.7
'****************************************************************
NEGAT_ISI CON 1           ' Negatif_Cold = 1
'****************************************************************
TUS         VAR BYTE
T           VAR BYTE
HAM         VAR WORD
ISI         var WORD
rtcsec      VAR BYTE
rtcmin      VAR BYTE
rtchour     VAR BYTE
TEMP        VAR BYTE
rtcyear     VAR BYTE
rtcmonth    VAR BYTE
rtcday      VAR BYTE
rtcdate     VAR BYTE
VERI        VAR BYTE
SAYI        VAR BYTE 
SIGN        VAR BYTE
FLOAT       var BYTE
mem         var byte
BIRLER      VAR BYTE
ONLAR       VAR BYTE
SIGN_BITI VAR HAM.Bit11   '   +/- sıcaklık İşaret biti,  1 = olursa eksi sıcaklık
'****************************************************************
gosub SENSORYAZ
GOSUB SENSOROKU
'****************************************************************
SUTUN     var Byte[8]   ' 1497 adet byte tipinde değişken tanımlanabilir.
RAKAM     VAR BYTE
ARA       VAR BYTE
I         var Byte
X         var Byte
W         var Byte
M         var WORD
'''''''''''''''''''
yazi_reg  var byte
harf_reg  var byte
z         var byte
y         var byte 
A         VAR BYTE
B         VAR BYTE
C         VAR BYTE
clear
pause 250
'****************************************************************
BASLA:
yazi_reg=0 
    For W=0 To 15
gosub yazi : yazi_Reg=yazi_reg+1
gosub data_al
aa:
      X=1
      For I=0 To 7
SHiftOut DTA1,CLK1,1,[SUTUN[I+88],SUTUN[I+80],SUTUN[I+72],_
SUTUN[I+64],SUTUN[I+56],SUTUN[I+48],SUTUN[I+40],_
  SUTUN[I+32],SUTUN[I+24],SUTUN[I+16],SUTUN[I+8],SUTUN[I]]
        PORTD=X
        High STROBE1 : pauseus 200 : Low STROBE1
        X=X*2
        pause 3
      Next
     Next
    pause 1
M=M+1
If M<128              Then gosub sola_kay   : goto aa : GOSUB SUTUN_TEMIZLE 
If M>128  and m<256   Then gosub saga_kay   : goto aa : GOSUB SUTUN_TEMIZLE
If M>256  and m<265   Then gosub asagi_kay  : goto aa : GOSUB SUTUN_TEMIZLE
if m>265  and m<274   then gosub yukari_kay : goto aa : GOSUB SUTUN_TEMIZLE
If m>274  then m=0  : GOSUB SUTUN_TEMIZLE
   
goto saat_goster

goto basla
'****************************************************************
SUTUN_TEMIZLE:
FOR I=0 TO 95
    SUTUN[I]=$00
NEXT I 
RETURN
'****************************************************************
SAAT_GOSTER:
GOSUB TUSAL
    IF TUS=1 THEN GOSUB GERI_SA
    IF TUS=0 THEN GOSUB ILERI_SA
C=C+1
    iF C=25 THEN C=0: GOSUB SUTUN_TEMIZLE : GOTO ISI_GOSTER
'''''''''''''''''''''
GOSUB ZAMAN_OKU
'''''''''''''''''''''
    FOR W=0 TO  7
'''''''''''''''''''''
if W=0 then
RAKAM=rtchour DiG 1 
GOSUB DATA_AL2
gosub GOSTER 
endif
'''''''''''''''''''''
if W=1 then
RAKAM=RTCHOUR DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if W=2 then
rakam=":"
gosub data_al2
gosub goster
ENDIF
'''''''''''''''''''''
if W=3 then
RAKAM=RTCmin  DiG 1 
GOSUB data_al2
gosub GOSTER
endif
'''''''''''''''''''''
if W=4 then
RAKAM=RTCMiN  DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if W=5 then
rakam=":"
gosub data_al2
gosub goster
ENDIF
'''''''''''''''''''''
if W=6 then
RAKAM=RTCsec  DiG 1 
GOSUB data_al2
gosub GOSTER
endif
'''''''''''''''''''''
if W=7 then
RAKAM=RTCsec  DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
    NEXT
goto SAAT_GOSTER
'****************************************************************
ISI_GOSTER:
GOSUB TUSAL
C=C+1
    iF C=5 THEN C=0: GOSUB SUTUN_TEMIZLE : GOTO TARIH_GOSTER
'''''''''''''''''''''
GOSUB SENSOROKU
FOR A=0 TO 3 
'''''''''''''''''''''
if a=0 then
RAKAM=ISI DIG 1
GOSUB DATA_AL2
GOSUB GOSTER
endif
'''''''''''''''''''''
if a=1 then
RAKAM=ISI DIG 0
GOSUB DATA_AL2
GOSUB GOSTER
endif
'''''''''''''''''''''
if a=2 then
rakam=223
gosub data_al2
gosub goster
endif
'''''''''''''''
if a=3 then
rakam="C"
gosub data_al2
gosub goster
endif
'''''''''''''''
NEXT
GOTO ISI_GOSTER
'****************************************************************
TARIH_GOSTER:
GOSUB TUSAL
C=C+1
    iF C=5 THEN C=0: GOSUB SUTUN_TEMIZLE : GOTO GUN_GOSTER
'''''''''''''''''''''
GOSUB ZAMAN_OKU
'''''''''''''''''''''
    FOR B=0 TO  7
'''''''''''''''''''''
if B=0 then
RAKAM=rtcDAte DiG 1 
GOSUB DATA_AL2
gosub GOSTER 
endif
'''''''''''''''''''''
if B=1 then
RAKAM=RTCdate DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if B=2 then
rakam="/"
gosub data_al2
gosub goster
ENDIF
'''''''''''''''''''''
if B=3 then
RAKAM=RTCmonth  DiG 1 
GOSUB data_al2
gosub GOSTER
endif
'''''''''''''''''''''
if B=4 then
RAKAM=RTCMonth  DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if B=5 then
rakam="/"
gosub data_al2
gosub goster
ENDIF
'''''''''''''''''''''
if B=6 then
RAKAM=RTCyear  DiG 1 
GOSUB data_al2
gosub GOSTER
endif
'''''''''''''''''''''
if B=7 then
RAKAM=RTCyear  DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
    NEXT
goto TARIH_GOSTER
'****************************************************************
GUN_GOSTER:
GOSUB TUSAL
C=C+1
    iF C=5 THEN C=0: GOSUB SUTUN_TEMIZLE : GOTO BASLA
'''''''''''''''''''''
GOSUB ZAMAN_OKU
gosub yazi1
GOSUB GOSTER2
goto GUN_GOSTER
'****************************************************************
GOSTER:
GOSUB TUSAL
      X=1
      For I=0 To 7
SHiftOut DTA1,CLK1,1,[SUTUN[I+88],SUTUN[I+80],SUTUN[I+72],_
SUTUN[I+64],SUTUN[I+56],SUTUN[I+48],SUTUN[I+40],_
  SUTUN[I+32],SUTUN[I+24],SUTUN[I+16],SUTUN[I+8],SUTUN[I]]
        PORTD=X
        High STROBE1 : pauseus 200 : Low STROBE1
        X=X*2
        pause 3
      Next
RETURN
'****************************************************************
GOSTER2:
GOSUB TUSAL
yazi_reg=0 
    For W=0 To 15
gosub yazi1 : yazi_reg=yazi_reg+1
gosub data_al
      X=1
      For I=0 To 7
SHiftOut DTA1,CLK1,1,[SUTUN[I+88],SUTUN[I+80],SUTUN[I+72],_
SUTUN[I+64],SUTUN[I+56],SUTUN[I+48],SUTUN[I+40],_
  SUTUN[I+32],SUTUN[I+24],SUTUN[I+16],SUTUN[I+8],SUTUN[I]]
        PORTD=X
        High STROBE1 : pauseus 200 : Low STROBE1
        X=X*2
        pause 3
      Next
     Next
    pause 1
RETURN
'****************************************************************
yazi:
LookUp yazi_reg,["KAYANYAZIPROJESI"],harf_reg
Return
'****************************************************************
yazi1:
if rtcday=1 then LookUp yazi_reg,["   PAZAR        "],harf_reg
if rtcday=2 then LookUp yazi_reg,[" PAZARTESi      "],harf_reg
if rtcday=3 then LookUp yazi_reg,["    SALI        "],harf_reg
if rtcday=4 then LookUp yazi_reg,["  CARSAMBA      "],harf_reg
if rtcday=5 then LookUp yazi_reg,["  PERSEMBE      "],harf_reg
if rtcday=6 then LookUp yazi_reg,["    CUMA        "],harf_reg
if rtcday=7 then LookUp yazi_reg,[" CUMARTESi      "],harf_reg
Return
'****************************************************************
sola_kay:
For I=0 To 126
    sutun[i]= sutun[i+1]
   If i=127 Then sutun[127]=sutun[0]
Next i
pauseus 10000
return
'****************************************************************
saga_kay:
For I=126 to 0 step -1
    sutun[i]= sutun[i-1]
   If i=0 Then sutun[0]=sutun[127]
Next i
pauseus 10000
return
'****************************************************************
asagi_kay:
for I=0 to 127
   ARA=SUTUN[I]
   z=ARA.7
FOR X=7 to 1 STEP -1
   ARA.0[x]=ARA.0[X-1]
NEXT
   ara.0=Z
   sutun[I]=ARA
next
pauseus 10000
Return
'****************************************************************
yukari_kay:
FOR I=0 to 127
   ARA=SUTUN[I]
   z=ARA.0
FOR X=0 to 6
   ARA.0[X]=ARA.0[X+1]
NEXT
   ARA.7=Z
   SUTUN[I]=ARA
NEXT
pauseus 10000
Return
'****************************************************************
'****************************************************************
'***********Zaman Oku***********
ZAMAN_OKU:
         High RTC_RST
         SHiftOut RTC_DTA, RTC_SCLK, 0, [$BF]
         SHiftIn RTC_DTA, RTC_SCLK, 1, [rtcsec, rtcmin, rtchour,rtcdate , rtcmonth,rtcday,rtcyear, MEM]
         Low RTC_RST
         MEM=rtcsec  : GoSub CEVIR:rtcsec=SAYI 
         MEM=rtcmin  : GoSub CEVIR:rtcmin=SAYI
         MEM=rtchour : GoSub CEVIR:rtchour=SAYI
         MEM=rtcdate : GoSub CEVIR:rtcdate=SAYI
         MEM=rtcmonth: GoSub CEVIR:rtcmonth=SAYI
         MEM=rtcyear : GoSub CEVIR:rtcyear=SAYI
         MEM=rtcday  : GoSub CEVIR: rtcday=SAYI       
         Return
'***********Zaman Yaz***********
ZAMAN_YAZ:
    MEM=rtcsec   : GoSub TERSCEVIR :rtcsec=SAYI
    MEM=rtcmin   : GoSub TERSCEVIR :rtcmin=SAYI
    MEM=rtchour  : GoSub TERSCEVIR :rtchour=SAYI
    MEM=rtcdate  : GoSub TERSCEVIR :rtcdate=SAYI
    MEM=rtcmonth : GoSub TERSCEVIR :rtcmonth=SAYI
    MEM=rtcyear  : GoSub TERSCEVIR :rtcyear=SAYI
    MEM=rtcday   : GoSub TERSCEVIR :rtcday=SAYI
       
    High  RTC_RST
    SHiftOut RTC_DTA, RTC_SCLK, 0, [$8E, 0]
    Low RTC_RST:pause 1
    High RTC_RST         
    SHiftOut  RTC_DTA, RTC_SCLK, 0, [$BE, rtcsec, rtcmin, rtchour,rtcdate , rtcmonth, rtcday, rtcyear, 0]  'YAZ
    Low RTC_RST
    pause 10
Return
'***********Çevir***********               
CEVIR:
    ONLAR=MEM & %01110000
    ONLAR=ONLAR>>4
    BIRLER=MEM & %00001111
    SAYI=ONLAR*10+BIRLER
RETURN 
'***********Ters Çevir***********
TERSCEVIR:               
    ONLAR=MEM DIG 1
    ONLAR=ONLAR<<4
    BIRLER=MEM DIG 0
    SAYI=ONLAR+BIRLER
RETURN   
'****************************************************************   
SENSOROKU:
           OWOUT   Comm_Pin, 1, [$CC, $44]' ISI değerini oku
Bekle:
'           OWIN    Comm_Pin, 4, [TEMP]    ' Busy değerini oku
'           IF      TEMP = 0 THEN Bekle  ' hala meşgulmü? , evet ise goto Bekle..!
           OWOUT   Comm_Pin, 1, [$CC, $BE]' scratchpad memory oku
           OWIN    Comm_Pin, 2, [HAM.Lowbyte, HAM.Highbyte]' İki byte oku ve okumayı bitir.
           GOSUB   Hesapla
           RETURN
'****************************************************************           
SENSORYAZ:
          OWOUT   COMM_Pin, 1, [$CC, $4E, $00,$00,$31]
          return           
'****************************************************************             
Hesapla:                 ' Ham değerden Santigrat derece hesabı
    Sign  = "+"
    IF SIGN_BITI = NEGAT_ISI THEN
       Sign   = "-" 
       ham=($ffff-ham)+1
    endif
    ISI = Ham*10/16
GEC:
    FLOAT = (ISI //10)
    ISI=ISI/10
    RETURN                     
'****************************************************************
'****************************************************************
'****************************************************************
'****************************************************************
TUSAL:
TUS=50
S1:IF PORTC.0=1 THEN TUS=TUS+1      :GOTO S1
S2:IF PORTC.1=1 THEN GOSUB ILERI_SA :GOTO S2
S3:IF PORTC.2=1 THEN GOSUB GERI_SA  :GOTO S3
    IF TUS<>50  THEN T=T+1
    IF T=2      THEN T=0
    IF TUS=2    THEN TUS=0 
RETURN
'****************************************************************
ILERI_SA:
    IF T=0 AND  PORTC.1=1 THEN RTCHOUR=RTCHOUR+1
    IF T=1 AND  PORTC.1=1 THEN RTCMIN=RTCMIN+1
    IF rtchour=24 THEN rtchour=0 : rtcdate=rtcdate+1 : rtcday=rtcday+1
    IF rtcmin=60 THEN rtcmin=0
gosub zaman_yaz   
GOSUB GECIKME
GOSUB ZAMAN_OKU 
RETURN
'****************************************************************
GERI_SA:
    IF T=0 AND  PORTC.2=1 THEN RTCHOUR=RTCHOUR-1
    IF T=1 AND  PORTC.2=1 THEN RTCMIN=RTCMIN-1
    IF rtchour=255 THEN rtchour=23 : rtcdate=rtcdate-1 : rtcday=rtcday-1
    IF rtcmin=255 THEN rtcmin=59
gosub zaman_yaz 
GOSUB GECIKME
GOSUB ZAMAN_OKU
RETURN
'****************************************************************   
GECIKME:
FOR VERI=0 TO 1800
PAUSEUS 1000
NEXT
RETURN
'****************************************************************
data_al:
Select Case harf_reg
i=0
if w=1  then  I=I+8 
if w=2  then  I=i+16
if w=3  then  I=i+24
if w=4  then  I=i+32
if w=5  then  I=i+40
if w=6  then  I=i+48
if w=7  then  I=i+56
if w=8  then  I=i+64
if w=9  then  I=i+72
if w=10 then  I=i+80
if w=11 then  I=i+88
if w=12 then  I=i+96
if w=13 then  I=i+104
if w=14 then  I=i+112
if w=15 then  I=i+120
'''''''''''''''''''
Case "A"
for t=0 to 7
lookup t,[$FF,$81,$F6,$F6,$F6,$F6,$81,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "B"
for t=0 to 7
lookup t,[$FF,$80,$B6,$B6,$B6,$B6,$C9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "C"
for t=0 to 7
lookup t,[$FF,$C1,$BE,$BE,$BE,$BE,$DD,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "D"
for t=0 to 7
lookup t,[ $FF,$80,$BE,$BE,$BE,$BE,$C1,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "E"
for t=0 to 7
lookup t,[$FF,$80,$B6,$B6,$B6,$B6,$BE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "F"
for t=0 to 7
lookup t,[ $FF,$80,$F6,$F6,$F6,$F6,$FE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "G"
for t=0 to 7
lookup t,[$FF,$80,$BE,$B6,$B6,$B6,$86,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "H"
for t=0 to 7
lookup t,[$FF,$80,$F7,$F7,$F7,$F7,$80,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "I"
for t=0 to 7
lookup t,[$FF,$BE,$BE,$80,$80,$BE,$BE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "i"
for t=0 to 7
lookup t,[$FF,$BF,$BB,$82,$82,$BB,$BF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
case "J"
for t=0 to 7
lookup t,[$FF,$CE,$BE,$80,$80,$FE,$FE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "K"
for t=0 to 7
lookup t,[$FF,$80,$F7,$EB,$DD,$BE,$FF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "L"
for t=0 to 7
lookup t,[$FF,$80,$BF,$BF,$BF,$BF,$BF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''                       
Case "M"
for t=0 to 7
lookup t,[$FF,$80,$FB,$F7,$F7,$FB,$80,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "N" 
for t=0 to 7
lookup t,[$FF,$80,$FB,$F7,$EF,$DF,$80,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "O"
for t=0 to 7
lookup t,[$FF,$C1,$BE,$BE,$BE,$BE,$C1,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "P"
for t=0 to 7
lookup t,[$FF,$80,$F6,$F6,$F6,$F6,$F9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "R"
for t=0 to 7
lookup t,[$FF,$80,$F6,$E6,$D6,$B6,$B9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "S"
for t=0 to 7
lookup t,[$FF,$D9,$B6,$B6,$B6,$B6,$CD,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "T"
for t=0 to 7
lookup t,[$FF,$FE,$FE,$80,$80,$FE,$FE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "U"                               
for t=0 to 7
lookup t,[$FF,$C0,$BF,$BF,$BF,$BF,$C0,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "V" 
for t=0 to 7
lookup t,[$FF,$E0,$DF,$BF,$BF,$DF,$E0,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "Y"
for t=0 to 7
lookup t,[$FF,$FC,$FB,$87,$87,$FB,$FC,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "Z"
for t=0 to 7
lookup t,[$FF,$9E,$AE,$B6,$BA,$BC,$BE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case " "
for t=0 to 7
lookup t,[$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
End Select
Return
'****************************************************************
data_al2:
Select Case RAKAM
i=0
if A=0  then  i=i+16
if A=1  THEN  I=I+24
if A=2  THEN  I=I+32
if A=3  THEN  I=I+40
''''''''''''''''''''
if w=0  then  I=I
if w=1  then  I=i+8
if w=2  then  I=i+32
if w=3  then  I=i+24
if w=4  then  I=i+32
if w=5  then  I=i+56
if w=6  then  I=i+48
if w=7  then  I=i+56
'''''''''''''''''''
if B=0  then  I=I
if B=1  then  I=i+8
if B=2  then  I=i+(-16)
if B=3  then  I=i+24
if B=4  then  I=i+32
if B=5  then  I=i+8
if B=6  then  I=i+48
if B=7  then  I=i+56
'''''''''''''''''''
Case 0
for t=0 to 7
lookup t,[$FF,$C1,$80,$A6,$B2,$80,$C1,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 1
for t=0 to 7
lookup t,[$FF,$BF,$BD,$80,$80,$BF,$BF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 2
for t=0 to 7
lookup t,[$FF,$9D,$8C,$A6,$B2,$98,$9D,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 3
for t=0 to 7
lookup t,[$FF,$DD,$9C,$B6,$B6,$80,$C9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 4
for t=0 to 7
lookup t,[$FF,$E7,$E3,$E9,$80,$80,$E7,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 5
for t=0 to 7
lookup t,[$FF,$D8,$98,$BA,$BA,$82,$C6,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 6
for t=0 to 7
lookup t,[$FF,$C3,$81,$B4,$B6,$86,$CF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 7
for t=0 to 7
lookup t,[$FF,$FC,$FC,$8E,$86,$F0,$F8,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 8
for t=0 to 7
lookup t,[$FF,$C9,$80,$B6,$B6,$80,$C9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 9
for t=0 to 7
lookup t,[$FF,$F9,$B0,$B6,$96,$C0,$E1,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case ":"
I=i+ -16     
for t=0 to 7
lookup t,[$FF,$FF,$FF,$99,$99,$FF,$FF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "/"
I=i+32
for t=0 to 7
lookup t,[$FF,$9F,$CF,$E7,$F3,$F9,$FC,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "C"
for t=0 to 7
lookup t,[$FF,$C1,$80,$BE,$BE,$BE,$DD,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
case 223   ' Derece işareti
for t=0 to 7
lookup t,[$FF,$FF,$F9,$F0,$F6,$F0,$F9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''   
   
End Select
Return

End





meyer

#23
  İyi akşamlar arkadaşlar,
Devre ile alakalı 1-2 eksikliği daha giderebildim..Şuan ki haliyle bir tek saat ve tarihin ayar kısmı çalışmıyor..Onuda halletmeye çalışıyorum..En kısa sürede bu sorunu da çözmeye çalışacağım..


'****************************************************************
'*  Name    : MATRIX_PANO_SAAT_ISI_TARIH_GUN_KAYAN_YAZI.BAS     *
'*  Author  : [HAKAN_ÖZKAN]                                     *
'*  Notice  : Copyright (c) 2011 [select VIEW...EDITOR OPTIONS] *
'*          : All Rights Reserved                               *
'*  Date    : 23.12.2011                                        *
'*  Version : 1.0                                               *
'*  Notes   :                                                   *
'*          :                                                   *
'****************************************************************
define OSC 20
'****************************************************************
TRISB=0 : TRISD=0  : TRISC=255 : TRISE=0 : TRISA=0
PORTB=0 : PORTD=0  : PORTC=0   : PORTE=0 : PORTA=0
INTCON2.7=0
'74HC595*********************************************************
Symbol CLK1     =PORTB.0
Symbol DTA1     =PORTB.1
Symbol STROBE1  =PORTB.2
'DS18B20*********************************************************
SYMBOL COMM_PIN =PORTB.3
'DS1302**********************************************************
symbol  RTC_RST =PORTB.5         'RTC nin bağlandığı portlar
symbol  RTC_SCLK=PORTB.6
symbol  RTC_DTA =PORTB.7
'****************************************************************
NEGAT_ISI CON 1                  ' Negatif_Cold = 1
'****************************************************************
TUS         VAR BYTE
T           VAR BYTE
HAM         VAR WORD
ISI         var WORD
rtcsec      VAR BYTE
rtcmin      VAR BYTE
rtchour     VAR BYTE
TEMP        VAR BYTE
rtcyear     VAR BYTE
rtcmonth    VAR BYTE
rtcday      VAR BYTE
rtcdate     VAR BYTE
VERI        VAR BYTE
SAYI        VAR BYTE 
SIGN        VAR BYTE
FLOAT       var BYTE
mem         var byte
BIRLER      VAR BYTE
ONLAR       VAR BYTE
SIGN_BITI VAR HAM.Bit11   '   +/- sıcaklık İşaret biti,  1 = olursa eksi sıcaklık
'****************************************************************
gosub SENSORYAZ
GOSUB SENSOROKU
'gosub ZAMAN_OKU
Low RTC_RST              ' RTC yi resetle
Low RTC_SCLK
'****************************************************************
SUTUN     var Byte[8]    ' 1497 adet byte tipinde değişken tanımlanabilir.
RAKAM     VAR BYTE
ARA       VAR BYTE
I         var Byte
X         var Byte
W         var Byte
M         var WORD
'''''''''''''''''''
yazi_reg  var byte
harf_reg  var byte
z         var byte
y         var byte 
A         VAR BYTE
B         VAR BYTE
C         VAR BYTE
clear
pause 250
'****************************************************************
BASLA:
yazi_reg=0 
    For W=0 To 11
gosub yazi : yazi_Reg=yazi_reg+1
gosub data_al
aa:
      X=1
      For I=0 To 7
SHiftOut DTA1,CLK1,1,[SUTUN[I+88],SUTUN[I+80],SUTUN[I+72],_
SUTUN[I+64],SUTUN[I+56],SUTUN[I+48],SUTUN[I+40],_
  SUTUN[I+32],SUTUN[I+24],SUTUN[I+16],SUTUN[I+8],SUTUN[I]]
        PORTD=X
        High STROBE1 : pauseus 200 : Low STROBE1
        X=X*2
        pause 3
      Next
     Next
    pause 1
M=M+1
If M<96               Then gosub sola_kay   : goto aa 
If M>96  and m<192    Then gosub saga_kay   : goto aa
If M>192  and m<201   Then gosub asagi_kay  : goto aa
if m>201  and m<210   then gosub yukari_kay : goto aa
If m>210  then m=0
   
goto saat_goster

goto basla
'****************************************************************
SAAT_GOSTER:
C=C+1
    iF C=25 THEN C=0:  GOTO ISI_GOSTER
   
GOSUB TUSAL
    IF TUS=1 THEN GOSUB GERI_SA
    IF TUS=0 THEN GOSUB ILERI_SA
'''''''''''''''''''''
GOSUB ZAMAN_OKU
'''''''''''''''''''''
    FOR W=0 TO  11
'''''''''''''''''''''
if W=0 then
RAKAM=rtchour DiG 1 
GOSUB DATA_AL2
gosub GOSTER 
endif
'''''''''''''''''''''
if W=1 then
RAKAM=RTCHOUR DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if W=2 then
rakam=":"
gosub data_al2
gosub goster
ENDIF
'''''''''''''''''''''
if W=3 then
RAKAM=RTCmin  DiG 1 
GOSUB data_al2
gosub GOSTER
endif
'''''''''''''''''''''
if W=4 then
RAKAM=RTCMiN  DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if W=5 then
rakam=":"
gosub data_al2
gosub goster
ENDIF
'''''''''''''''''''''
if W=6 then
RAKAM=RTCsec  DiG 1 
GOSUB data_al2
gosub GOSTER
endif
'''''''''''''''''''''
if W=7 then
RAKAM=RTCsec  DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if W=8 OR W=9 OR W=10 OR W=11 then
RAKAM=" " 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
    NEXT
W=0
goto SAAT_GOSTER
'****************************************************************
ISI_GOSTER:
C=C+1
    iF C=20 THEN C=0:  GOTO TARIH_GOSTER
'''''''''''''''''''''
GOSUB SENSOROKU
FOR A=0 TO 11 
'''''''''''''''''''''
if a=0 then
RAKAM=ISI DIG 1
GOSUB DATA_AL2
GOSUB GOSTER
endif
'''''''''''''''''''''
if a=1 then
RAKAM=ISI DIG 0
GOSUB DATA_AL2
GOSUB GOSTER
endif
'''''''''''''''''''''
if a=2 then
rakam=223
gosub data_al2
gosub goster
endif
'''''''''''''''
if a=3 then
rakam="C"
gosub data_al2
gosub goster
endif
'''''''''''''''
if sign="-" then
if A=10 then
RAKAM="-" 
GOSUB DATA_AL2
gosub GOSTER
endif
endif
'''''''''''''''
if sign="+" then
if A=4 OR A=5 OR A=6 OR A=7 OR A=8 OR A=9 OR A=10 OR A=11 then
RAKAM=" " 
GOSUB DATA_AL2
gosub GOSTER
endif
endif
'''''''''''''''''''''
NEXT
A=0
GOTO ISI_GOSTER
'****************************************************************
TARIH_GOSTER:
GOSUB TUSAL
C=C+1
    iF C=20 THEN C=0:  GOTO GUN_GOSTER
'''''''''''''''''''''
GOSUB ZAMAN_OKU
'''''''''''''''''''''
    FOR B=0 TO  11
'''''''''''''''''''''
if B=0 then
RAKAM=rtcDAte DiG 1 
GOSUB DATA_AL2
gosub GOSTER 
endif
'''''''''''''''''''''
if B=1 then
RAKAM=RTCdate DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if B=2 then
rakam="/"
gosub data_al2
gosub goster
ENDIF
'''''''''''''''''''''
if B=3 then
RAKAM=RTCmonth  DiG 1 
GOSUB data_al2
gosub GOSTER
endif
'''''''''''''''''''''
if B=4 then
RAKAM=RTCMonth  DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if B=5 then
rakam="/"
gosub data_al2
gosub goster
ENDIF
'''''''''''''''''''''
if B=6 then
RAKAM=RTCyear  DiG 1 
GOSUB data_al2
gosub GOSTER
endif
'''''''''''''''''''''
if B=7 then
RAKAM=RTCyear  DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if B=8  OR B=9 OR B=10 OR B=11 then
RAKAM=" " 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
    NEXT
B=0
goto TARIH_GOSTER
'****************************************************************
GUN_GOSTER:
C=C+1
    iF C=10 THEN C=0:  GOTO BASLA
'''''''''''''''''''''
GOSUB ZAMAN_OKU
gosub yazi1
GOSUB GOSTER2
goto GUN_GOSTER
'****************************************************************
GOSTER:
      X=1
      For I=0 To 7
SHiftOut DTA1,CLK1,1,[SUTUN[I+88],SUTUN[I+80],SUTUN[I+72],_
SUTUN[I+64],SUTUN[I+56],SUTUN[I+48],SUTUN[I+40],_
  SUTUN[I+32],SUTUN[I+24],SUTUN[I+16],SUTUN[I+8],SUTUN[I]]
        PORTD=X
        High STROBE1 : pauseus 200 : Low STROBE1
        X=X*2
        pause 3
      Next
RETURN
'****************************************************************
GOSTER2:
yazi_reg=0 
    For W=0 To 15
gosub yazi1 : yazi_reg=yazi_reg+1
gosub data_al
      X=1
      For I=0 To 7
SHiftOut DTA1,CLK1,1,[SUTUN[I+88],SUTUN[I+80],SUTUN[I+72],_
SUTUN[I+64],SUTUN[I+56],SUTUN[I+48],SUTUN[I+40],_
  SUTUN[I+32],SUTUN[I+24],SUTUN[I+16],SUTUN[I+8],SUTUN[I]]
        PORTD=X
        High STROBE1 : pauseus 200 : Low STROBE1
        X=X*2
        pause 3
      Next
     Next
    pause 1
RETURN
'****************************************************************
yazi:
LookUp yazi_reg,[" ELEKTRONiK "],harf_reg
Return
'****************************************************************
yazi1:
if rtcday=1 then LookUp yazi_reg,["   PAZAR    "],harf_reg
if rtcday=2 then LookUp yazi_reg,[" PAZARTESi  "],harf_reg
if rtcday=3 then LookUp yazi_reg,["    SALI    "],harf_reg
if rtcday=4 then LookUp yazi_reg,["  CARSAMBA  "],harf_reg
if rtcday=5 then LookUp yazi_reg,["  PERSEMBE  "],harf_reg
if rtcday=6 then LookUp yazi_reg,["    CUMA    "],harf_reg
if rtcday=7 then LookUp yazi_reg,[" CUMARTESi  "],harf_reg
Return
'****************************************************************
sola_kay:
For I=0 To 94
    sutun[i]= sutun[i+1]
   If i=95 Then sutun[95]=sutun[0]
Next i
pauseus 10000
return
'****************************************************************
saga_kay:
For I=94 to 0 step -1
    sutun[i]= sutun[i-1]
   If i=0 Then sutun[0]=sutun[95]
Next i
pauseus 10000
return
'****************************************************************
asagi_kay:
for I=0 to 95
   ARA=SUTUN[I]
   z=ARA.7
FOR X=7 to 1 STEP -1
   ARA.0[x]=ARA.0[X-1]
NEXT
   ara.0=Z
   sutun[I]=ARA
next
pauseus 10000
Return
'****************************************************************
yukari_kay:
FOR I=0 to 95
   ARA=SUTUN[I]
   z=ARA.0
FOR X=0 to 6
   ARA.0[X]=ARA.0[X+1]
NEXT
   ARA.7=Z
   SUTUN[I]=ARA
NEXT
pauseus 10000
Return
'**************************************************************** 
'Sensör_Oku******************************************************
SENSOROKU:
           OWOUT   Comm_Pin, 1, [$CC, $44]' ISI değerini oku
Bekle:
'           OWIN    Comm_Pin, 4, [TEMP]    ' Busy değerini oku
'           IF      TEMP = 0 THEN Bekle  ' hala meşgulmü? , evet ise goto Bekle..!
           OWOUT   Comm_Pin, 1, [$CC, $BE]' scratchpad memory oku
           OWIN    Comm_Pin, 2, [HAM.Lowbyte, HAM.Highbyte]' İki byte oku ve okumayı bitir.
           GOSUB   Hesapla
           RETURN
'****************************************************************           
SENSORYAZ:
          OWOUT   COMM_Pin, 1, [$CC, $4E, $00,$00,$31]
          return           
'****************************************************************             
Hesapla:                 ' Ham değerden Santigrat derece hesabı
    Sign  = "+"
    IF SIGN_BITI = NEGAT_ISI THEN
       Sign   = "-" 
       ham=($ffff-ham)+1
    endif
    ISI = Ham*10/16
GEC:
    FLOAT = (ISI //10)
    ISI=ISI/10
    RETURN                     
'****************************************************************
'****************************************************************
'***********Zaman Oku***********
ZAMAN_OKU:
         High RTC_RST
         SHiftOut RTC_DTA, RTC_SCLK, 0, [$BF]
         SHiftIn RTC_DTA, RTC_SCLK, 1, [rtcsec, rtcmin, rtchour,rtcdate , rtcmonth,rtcday,rtcyear, MEM]
         Low RTC_RST
         MEM=rtcsec  : GoSub CEVIR:rtcsec=SAYI 
         MEM=rtcmin  : GoSub CEVIR:rtcmin=SAYI
         MEM=rtchour : GoSub CEVIR:rtchour=SAYI
         MEM=rtcdate : GoSub CEVIR:rtcdate=SAYI
         MEM=rtcmonth: GoSub CEVIR:rtcmonth=SAYI
         MEM=rtcyear : GoSub CEVIR:rtcyear=SAYI
         MEM=rtcday  : GoSub CEVIR: rtcday=SAYI       
         Return
'***********Zaman Yaz***********
ZAMAN_YAZ:
    MEM=rtcsec   : GoSub TERSCEVIR :rtcsec=SAYI
    MEM=rtcmin   : GoSub TERSCEVIR :rtcmin=SAYI
    MEM=rtchour  : GoSub TERSCEVIR :rtchour=SAYI
    MEM=rtcdate  : GoSub TERSCEVIR :rtcdate=SAYI
    MEM=rtcmonth : GoSub TERSCEVIR :rtcmonth=SAYI
    MEM=rtcyear  : GoSub TERSCEVIR :rtcyear=SAYI
    MEM=rtcday   : GoSub TERSCEVIR :rtcday=SAYI
       
    High  RTC_RST
    SHiftOut RTC_DTA, RTC_SCLK, 0, [$8E, 0]
    Low RTC_RST:pause 1
    High RTC_RST         
    SHiftOut  RTC_DTA, RTC_SCLK, 0, [$BE, rtcsec, rtcmin, rtchour,rtcdate , rtcmonth, rtcday, rtcyear, 0]  'YAZ
    Low RTC_RST
    pause 10
Return
'***********Çevir***********               
CEVIR:
    ONLAR=MEM & %01110000
    ONLAR=ONLAR>>4
    BIRLER=MEM & %00001111
    SAYI=ONLAR*10+BIRLER
RETURN 
'***********Ters Çevir***********
TERSCEVIR:               
    ONLAR=MEM DIG 1
    ONLAR=ONLAR<<4
    BIRLER=MEM DIG 0
    SAYI=ONLAR+BIRLER
RETURN   
'****************************************************************
'****************************************************************
TUSAL:
TUS=50
S1:IF PORTC.0=1 THEN TUS=TUS+1      :GOTO S1
S2:IF PORTC.1=1 THEN GOSUB ILERI_SA :GOTO S2
S3:IF PORTC.2=1 THEN GOSUB GERI_SA  :GOTO S3
    IF TUS<>50  THEN T=T+1
    IF T=2      THEN T=0
    IF TUS=2    THEN TUS=0 
RETURN
'****************************************************************
ILERI_SA:
    IF T=0 AND  PORTC.1=1 THEN RTCHOUR=RTCHOUR+1
    IF T=1 AND  PORTC.1=1 THEN RTCMIN=RTCMIN+1
    IF rtchour=24 THEN rtchour=0 : rtcdate=rtcdate+1 : rtcday=rtcday+1
    IF rtcmin=60 THEN rtcmin=0
gosub zaman_yaz   
'GOSUB GECIKME
GOSUB ZAMAN_OKU 
RETURN
'****************************************************************
GERI_SA:
    IF T=0 AND  PORTC.2=1 THEN RTCHOUR=RTCHOUR-1
    IF T=1 AND  PORTC.2=1 THEN RTCMIN=RTCMIN-1
    IF rtchour=255 THEN rtchour=23 : rtcdate=rtcdate-1 : rtcday=rtcday-1
    IF rtcmin=255 THEN rtcmin=59
gosub zaman_yaz 
'GOSUB GECIKME
GOSUB ZAMAN_OKU
RETURN
'****************************************************************   
GECIKME:
FOR VERI=0 TO 1800
PAUSEUS 1000
NEXT
RETURN
'****************************************************************
'****************************************************************
data_al:
Select Case harf_reg
i=0
if w=1  then  I=I+8 
if w=2  then  I=i+16
if w=3  then  I=i+24
if w=4  then  I=i+32
if w=5  then  I=i+40
if w=6  then  I=i+48
if w=7  then  I=i+56
if w=8  then  I=i+64
if w=9  then  I=i+72
if w=10 then  I=i+80
if w=11 then  I=i+88
if w=12 then  I=i+96
if w=13 then  I=i+104
if w=14 then  I=i+112
if w=15 then  I=i+120
'''''''''''''''''''
Case "A"
for t=0 to 7
lookup t,[$FF,$81,$F6,$F6,$F6,$F6,$81,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "B"
for t=0 to 7
lookup t,[$FF,$80,$B6,$B6,$B6,$B6,$C9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "C"
for t=0 to 7
lookup t,[$FF,$C1,$BE,$BE,$BE,$BE,$DD,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "D"
for t=0 to 7
lookup t,[ $FF,$80,$BE,$BE,$BE,$BE,$C1,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "E"
for t=0 to 7
lookup t,[$FF,$80,$B6,$B6,$B6,$B6,$BE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "F"
for t=0 to 7
lookup t,[ $FF,$80,$F6,$F6,$F6,$F6,$FE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "G"
for t=0 to 7
lookup t,[$FF,$80,$BE,$B6,$B6,$B6,$86,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "H"
for t=0 to 7
lookup t,[$FF,$80,$F7,$F7,$F7,$F7,$80,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "I"
for t=0 to 7
lookup t,[$FF,$BE,$BE,$80,$80,$BE,$BE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "i"
for t=0 to 7
lookup t,[$FF,$BF,$BB,$82,$82,$BB,$BF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
case "J"
for t=0 to 7
lookup t,[$FF,$CE,$BE,$80,$80,$FE,$FE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "K"
for t=0 to 7
lookup t,[$FF,$80,$F7,$EB,$DD,$BE,$FF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "L"
for t=0 to 7
lookup t,[$FF,$80,$BF,$BF,$BF,$BF,$BF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''                       
Case "M"
for t=0 to 7
lookup t,[$FF,$80,$FB,$F7,$F7,$FB,$80,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "N" 
for t=0 to 7
lookup t,[$FF,$80,$FB,$F7,$EF,$DF,$80,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "O"
for t=0 to 7
lookup t,[$FF,$C1,$BE,$BE,$BE,$BE,$C1,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "P"
for t=0 to 7
lookup t,[$FF,$80,$F6,$F6,$F6,$F6,$F9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "R"
for t=0 to 7
lookup t,[$FF,$80,$F6,$E6,$D6,$B6,$B9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "S"
for t=0 to 7
lookup t,[$FF,$D9,$B6,$B6,$B6,$B6,$CD,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "T"
for t=0 to 7
lookup t,[$FF,$FE,$FE,$80,$80,$FE,$FE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "U"                               
for t=0 to 7
lookup t,[$FF,$C0,$BF,$BF,$BF,$BF,$C0,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "V" 
for t=0 to 7
lookup t,[$FF,$E0,$DF,$BF,$BF,$DF,$E0,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "Y"
for t=0 to 7
lookup t,[$FF,$FC,$FB,$87,$87,$FB,$FC,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "Z"
for t=0 to 7
lookup t,[$FF,$9E,$AE,$B6,$BA,$BC,$BE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case " "
for t=0 to 7
lookup t,[$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
End Select
Return
'****************************************************************
data_al2:
Select Case RAKAM
i=0
'SICAKLIK'''''''''''
if A=0  then  i=i+48
if A=1  THEN  I=I+56
if A=2  THEN  I=I+64
if A=3  THEN  I=I+72
if A=4  THEN  I=i+80
if A=5  THEN  I=i+88
if A=6  THEN  I=I+96
if A=7  THEN  I=I+104
if A=8  THEN  I=I+112
if A=9  THEN  I=I+120
if A=10 THEN  I=I+40
if A=11 THEN  I=I+32
'SAAT'''''''''''''''
if w=0  then  I=I+(-16)
if w=1  then  I=i+(-8)
if w=2  then  I=i+16
if w=3  then  I=i+8
if w=4  then  I=i+16
if w=5  then  I=i+40
if w=6  then  I=i+32
if w=7  then  I=i+40
if w=8  then  I=i+(-24)
if w=9  then  I=i+(-32)
if w=10 then  I=i+48
if w=11 then  I=i+56
'TARIH''''''''''''
if B=0  then  I=I+(-16)
if B=1  then  I=i+(-8)
if B=2  then  I=i+(-32)
if B=3  then  I=i+8
if B=4  then  I=i+16
if B=5  then  I=i+(-8)
if B=6  then  I=i+32
if B=7  then  I=I+40
if B=8  then  I=i+48
if B=9  then  I=i+56
if B=10 then  I=i+(-24)
if B=11 then  I=I+(-32)
'''''''''''''''''''
Case 0
for t=0 to 7
lookup t,[$FF,$C1,$80,$A6,$B2,$80,$C1,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 1
for t=0 to 7
lookup t,[$FF,$BF,$BD,$80,$80,$BF,$BF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 2
for t=0 to 7
lookup t,[$FF,$9D,$8C,$A6,$B2,$98,$9D,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 3
for t=0 to 7
lookup t,[$FF,$DD,$9C,$B6,$B6,$80,$C9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 4
for t=0 to 7
lookup t,[$FF,$E7,$E3,$E9,$80,$80,$E7,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 5
for t=0 to 7
lookup t,[$FF,$D8,$98,$BA,$BA,$82,$C6,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 6
for t=0 to 7
lookup t,[$FF,$C3,$81,$B4,$B6,$86,$CF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 7
for t=0 to 7
lookup t,[$FF,$FC,$FC,$8E,$86,$F0,$F8,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 8
for t=0 to 7
lookup t,[$FF,$C9,$80,$B6,$B6,$80,$C9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 9
for t=0 to 7
lookup t,[$FF,$F9,$B0,$B6,$96,$C0,$E1,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case ":"
I=i+ -16     
for t=0 to 7
lookup t,[$FF,$FF,$FF,$99,$99,$FF,$FF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "/"
I=i+32
for t=0 to 7
lookup t,[$FF,$9F,$CF,$E7,$F3,$F9,$FC,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "C"
for t=0 to 7
lookup t,[$FF,$C1,$80,$BE,$BE,$BE,$DD,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
case 223   ' Derece işareti
for t=0 to 7
lookup t,[$FF,$FF,$F9,$F0,$F6,$F0,$F9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
case "-"   
for t=0 to 7
lookup t,[$FF,$E7,$E7,$E7,$E7,$E7,$E7,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''   
Case " "
for t=0 to 7
lookup t,[$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
   
End Select
Return

End





meyer

#24
  İyi günler Ete Hocam,
Hocam,projedeki saatin ayar kısmını bir türlü yapamadım.Kullandığım ayar kodları ile daha önce 7 segmentli ve glcd'li  bir saat yapmıştım ama bu devrede saat entegresine bir türlü bu ayarı yaptıramadım.Hocam,rica etsem kodlara bir bakıp,eksik kısmını söyleyebilir misiniz..
Yardımınız için şimdiden teşekkür ederim hocam..İyi günler dilerim...


SAAT_GOSTER:
GOSUB TUSAL
    IF TUS=1 THEN GOSUB GERI_SA
    IF TUS=0 THEN GOSUB ILERI_SA
'''''''''''''''''''''
C=C+1
    iF C=25 THEN C=0:  GOTO ISI_GOSTER
'''''''''''''''''''''
GOSUB ZAMAN_OKU
'''''''''''''''''''''
    FOR W=0 TO  11
'''''''''''''''''''''
if W=0 then
RAKAM=rtchour DiG 1 
GOSUB DATA_AL2
gosub GOSTER 
endif
'''''''''''''''''''''
if W=1 then
RAKAM=RTCHOUR DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if W=2 then
rakam=":"
gosub data_al2
gosub goster
ENDIF
'''''''''''''''''''''
if W=3 then
RAKAM=RTCmin  DiG 1 
GOSUB data_al2
gosub GOSTER
endif
'''''''''''''''''''''
if W=4 then
RAKAM=RTCMiN  DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if W=5 then
rakam=":"
gosub data_al2
gosub goster
ENDIF
'''''''''''''''''''''
if W=6 then
RAKAM=RTCsec  DiG 1 
GOSUB data_al2
gosub GOSTER
endif
'''''''''''''''''''''
if W=7 then
RAKAM=RTCsec  DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if W=8 OR W=9 OR W=10 OR W=11 then
RAKAM=" " 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
    NEXT
W=0
goto SAAT_GOSTER
'****************************************************************
TUSAL:
TUS=50
S1:IF PORTC.0=1 THEN TUS=TUS+1      :GOTO S1
S2:IF PORTC.1=1 THEN GOSUB ILERI_SA :GOTO S2
S3:IF PORTC.2=1 THEN GOSUB GERI_SA  :GOTO S3
    IF TUS<>50  THEN T=T+1
    IF T=2      THEN T=0
    IF TUS=2    THEN TUS=0 
RETURN
'****************************************************************
ILERI_SA:
    IF T=0 AND  PORTC.1=1 THEN RTCHOUR=RTCHOUR+1
    IF T=1 AND  PORTC.1=1 THEN RTCMIN=RTCMIN+1
    IF rtchour=24 THEN rtchour=0 : rtcdate=rtcdate+1 : rtcday=rtcday+1
    IF rtcmin=60 THEN rtcmin=0
gosub zaman_yaz   
GOSUB ZAMAN_OKU 
RETURN
'****************************************************************
GERI_SA:
    IF T=0 AND  PORTC.2=1 THEN RTCHOUR=RTCHOUR-1
    IF T=1 AND  PORTC.2=1 THEN RTCMIN=RTCMIN-1
    IF rtchour=255 THEN rtchour=23 : rtcdate=rtcdate-1 : rtcday=rtcday-1
    IF rtcmin=255 THEN rtcmin=59
gosub zaman_yaz 
GOSUB ZAMAN_OKU
RETURN
'***************************************************************

meyer

#25
  İyi akşamlar arkadaşlar,
Devrenin saat ayar kısmını halledebildim ama öle aman aman bir ayar menüsü olmadı şimdilik..Ayar yapılması ise şöyle;
Portc.0,1,2  pinlerine bağlı olan butonlardan herhangi birisine basıldığında program ayar menüsüne dallanıyor.Portc.0 ile  saat/dakika ayarı yapılıyor.Portc.1 ileri,portc.2'den de geri ayarı yapılıyor.Menüden çıkmak için de portc.3'e basmak yeterli..
Şimdilik bunu yapabildim arkadaşlar..Daha iyi bir menü yapabilirsem eğer en kısa sürede paylaşacağım..
Herkese iyi günler dilerim...


'****************************************************************
'*  Name    : MATRIX_PANO_SAAT_ISI_TARIH_GUN_KAYAN_YAZI.BAS     *
'*  Author  : [HAKAN_ÖZKAN]                                     *
'*  Notice  : Copyright (c) 2011 [select VIEW...EDITOR OPTIONS] *
'*          : All Rights Reserved                               *
'*  Date    : 23.12.2011                                        *
'*  Version : 1.0                                               *
'*  Notes   :                                                   *
'*          :                                                   *
'****************************************************************
define OSC 20
'****************************************************************
TRISB=0 : TRISD=0  : TRISC=7   : TRISE=0 : TRISA=0
PORTB=0 : PORTD=0  : PORTC=0   : PORTE=0 : PORTA=0
INTCON2.7=0
'74HC595*********************************************************
Symbol CLK1     =PORTB.0
Symbol DTA1     =PORTB.1
Symbol STROBE1  =PORTB.2
'DS18B20*********************************************************
SYMBOL COMM_PIN =PORTB.3
'DS1302**********************************************************
symbol  RTC_RST =PORTB.5         'RTC nin bağlandığı portlar
symbol  RTC_SCLK=PORTB.6
symbol  RTC_DTA =PORTB.7
'****************************************************************
NEGAT_ISI CON 1                  ' Negatif_Cold = 1
'****************************************************************
TUS         VAR BYTE
T           VAR BYTE
HAM         VAR WORD
ISI         var WORD
rtcsec      VAR BYTE
rtcmin      VAR BYTE
rtchour     VAR BYTE
rtcyear     VAR BYTE
rtcmonth    VAR BYTE
rtcday      VAR BYTE
rtcdate     VAR BYTE
TEMP        VAR BYTE
VERI        VAR BYTE
SAYI        VAR BYTE 
SIGN        VAR BYTE
FLOAT       var BYTE
mem         var byte
BIRLER      VAR BYTE
ONLAR       VAR BYTE
SIGN_BITI VAR HAM.Bit11   '   +/- sıcaklık İşaret biti,  1 = olursa eksi sıcaklık
'****************************************************************
SUTUN     var Byte[8]    ' 1497 adet byte tipinde değişken tanımlanabilir.
RAKAM     VAR BYTE
ARA       VAR BYTE
I         var Byte
X         var Byte
W         var Byte
M         var WORD
'''''''''''''''''''
yazi_reg  var byte
harf_reg  var byte
z         var byte
y         var byte 
A         VAR BYTE
B         VAR BYTE
C         VAR BYTE
'****************************************************************
gosub SENSORYAZ
GOSUB SENSOROKU
'gosub ZAMAN_OKU
Low RTC_RST              ' RTC yi resetle
Low RTC_SCLK
'****************************************************************
clear
pause 250
'****************************************************************
BASLA:
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto ayar
yazi_reg=0 
    For W=0 To 11
gosub yazi : yazi_Reg=yazi_reg+1
gosub data_al
aa:
      X=1
      For I=0 To 7
SHiftOut DTA1,CLK1,1,[SUTUN[I+88],SUTUN[I+80],SUTUN[I+72],_
SUTUN[I+64],SUTUN[I+56],SUTUN[I+48],SUTUN[I+40],_
  SUTUN[I+32],SUTUN[I+24],SUTUN[I+16],SUTUN[I+8],SUTUN[I]]
        PORTD=X
        High STROBE1 : pauseus 200 : Low STROBE1
        X=X*2
        pause 3
      Next
     Next
    pause 1
M=M+1
If M<96               Then gosub sola_kay   : goto aa 
If M>96  and m<192    Then gosub saga_kay   : goto aa
If M>192  and m<201   Then gosub asagi_kay  : goto aa
if m>201  and m<210   then gosub yukari_kay : goto aa
If m>210  then m=0
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto ayar
goto saat_goster
goto basla
'****************************************************************
'****************************************************************
ayar:
gosub zaman_oku
If portc.0=1 then t=t+1
    IF T=0 AND  PORTC.1=1 THEN RTCHOUR=RTCHOUR+1
    IF T=1 AND  PORTC.1=1 THEN RTCMIN=RTCMIN+1
    IF T=0 AND  PORTC.2=1 THEN RTCHOUR=RTCHOUR-1
    IF T=1 AND  PORTC.2=1 THEN RTCMIN=RTCMIN-1
        IF rtchour=24     THEN rtchour=0 : rtcdate=rtcdate+1 : rtcday=rtcday+1
        IF rtcmin=60      THEN rtcmin=0
        IF rtchour=255    THEN rtchour=23 : rtcdate=rtcdate-1 : rtcday=rtcday-1
        IF rtcmin=255     THEN rtcmin=59
        if t=2            then t=0
gosub zaman_yaz 
GOSUB GECIKME
GOSUB ZAMAN_OKU
    if portc.3=1 then goto saat_goster
goto ayar
'****************************************************************
GECIKME:
FOR VERI=0 TO 1800
PAUSEUS 1000
NEXT
RETURN
'**************************************************************** 
saat_goster:
C=C+1
    iF C=20 THEN C=0:  GOTO ISI_GOSTER
'''''''''''''''''''''
GOSUB ZAMAN_OKU
'''''''''''''''''''''
    FOR W=0 TO  11
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto ayar
'''''''''''''''''''''
if W=0 then
RAKAM=rtchour DiG 1 
GOSUB DATA_AL2
gosub GOSTER 
endif
'''''''''''''''''''''
if W=1 then
RAKAM=RTCHOUR DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if W=2 then
rakam=":"
gosub data_al2
gosub goster
ENDIF
'''''''''''''''''''''
if W=3 then
RAKAM=RTCmin  DiG 1 
GOSUB data_al2
gosub GOSTER
endif
'''''''''''''''''''''
if W=4 then
RAKAM=RTCMiN  DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if W=5 then
rakam=":"
gosub data_al2
gosub goster
ENDIF
'''''''''''''''''''''
if W=6 then
RAKAM=RTCsec  DiG 1 
GOSUB data_al2
gosub GOSTER
endif
'''''''''''''''''''''
if W=7 then
RAKAM=RTCsec  DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if W=8 OR W=9 OR W=10 OR W=11 then
RAKAM=" " 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
    NEXT
W=0
goto SAAT_GOSTER
'****************************************************************
ISI_GOSTER:
C=C+1
    iF C=20 THEN C=0:  GOTO TARIH_GOSTER
'''''''''''''''''''''
GOSUB SENSOROKU
FOR A=0 TO 11 
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto ayar
'''''''''''''''''''''
if a=0 then
RAKAM=ISI DIG 1
GOSUB DATA_AL2
GOSUB GOSTER
endif
'''''''''''''''''''''
if a=1 then
RAKAM=ISI DIG 0
GOSUB DATA_AL2
GOSUB GOSTER
endif
'''''''''''''''''''''
if a=2 then
rakam=223
gosub data_al2
gosub goster
endif
'''''''''''''''
if a=3 then
rakam="C"
gosub data_al2
gosub goster
endif
'''''''''''''''
if sign="-" then
if A=10 then
RAKAM="-" 
GOSUB DATA_AL2
gosub GOSTER
endif
endif
'''''''''''''''
if sign="+" then
if A=4 OR A=5 OR A=6 OR A=7 OR A=8 OR A=9 OR A=10 OR A=11 then
RAKAM=" " 
GOSUB DATA_AL2
gosub GOSTER
endif
endif
'''''''''''''''''''''
NEXT
A=0
GOTO ISI_GOSTER
'****************************************************************
TARIH_GOSTER:
C=C+1
    iF C=15 THEN C=0:  GOTO GUN_GOSTER
'''''''''''''''''''''
GOSUB ZAMAN_OKU
'''''''''''''''''''''
    FOR B=0 TO  11
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto ayar
'''''''''''''''''''''
if B=0 then
RAKAM=rtcDAte DiG 1 
GOSUB DATA_AL2
gosub GOSTER 
endif
'''''''''''''''''''''
if B=1 then
RAKAM=RTCdate DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if B=2 then
rakam="/"
gosub data_al2
gosub goster
ENDIF
'''''''''''''''''''''
if B=3 then
RAKAM=RTCmonth  DiG 1 
GOSUB data_al2
gosub GOSTER
endif
'''''''''''''''''''''
if B=4 then
RAKAM=RTCMonth  DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if B=5 then
rakam="/"
gosub data_al2
gosub goster
ENDIF
'''''''''''''''''''''
if B=6 then
RAKAM=RTCyear  DiG 1 
GOSUB data_al2
gosub GOSTER
endif
'''''''''''''''''''''
if B=7 then
RAKAM=RTCyear  DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if B=8  OR B=9 OR B=10 OR B=11 then
RAKAM=" " 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
    NEXT
B=0
goto TARIH_GOSTER
'****************************************************************
GUN_GOSTER:
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto ayar
C=C+1
    iF C=5 THEN C=0:  GOTO BASLA
'''''''''''''''''''''
GOSUB ZAMAN_OKU
gosub yazi1
GOSUB GOSTER2
goto GUN_GOSTER
'****************************************************************
GOSTER:
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto ayar
      X=1
      For I=0 To 7
SHiftOut DTA1,CLK1,1,[SUTUN[I+88],SUTUN[I+80],SUTUN[I+72],_
SUTUN[I+64],SUTUN[I+56],SUTUN[I+48],SUTUN[I+40],_
  SUTUN[I+32],SUTUN[I+24],SUTUN[I+16],SUTUN[I+8],SUTUN[I]]
        PORTD=X
        High STROBE1 : pauseus 200 : Low STROBE1
        X=X*2
        pause 3
      Next
RETURN
'****************************************************************
GOSTER2:
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto ayar
yazi_reg=0 
    For W=0 To 11
gosub yazi1 : yazi_reg=yazi_reg+1
gosub data_al
      X=1
      For I=0 To 7
SHiftOut DTA1,CLK1,1,[SUTUN[I+88],SUTUN[I+80],SUTUN[I+72],_
SUTUN[I+64],SUTUN[I+56],SUTUN[I+48],SUTUN[I+40],_
  SUTUN[I+32],SUTUN[I+24],SUTUN[I+16],SUTUN[I+8],SUTUN[I]]
        PORTD=X
        High STROBE1 : pauseus 200 : Low STROBE1
        X=X*2
        pause 3
      Next
     Next
    pause 1
RETURN
'****************************************************************
yazi:
LookUp yazi_reg,[" ELEKTRONiK "],harf_reg
Return
'****************************************************************
yazi1:
if rtcday=1 then LookUp yazi_reg,["   PAZAR    "],harf_reg
if rtcday=2 then LookUp yazi_reg,[" PAZARTESi  "],harf_reg
if rtcday=3 then LookUp yazi_reg,["    SALI    "],harf_reg
if rtcday=4 then LookUp yazi_reg,["  CARSAMBA  "],harf_reg
if rtcday=5 then LookUp yazi_reg,["  PERSEMBE  "],harf_reg
if rtcday=6 then LookUp yazi_reg,["    CUMA    "],harf_reg
if rtcday=7 then LookUp yazi_reg,[" CUMARTESi  "],harf_reg
Return
'****************************************************************
sola_kay:
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto ayar
For I=0 To 94
    sutun[i]= sutun[i+1]
   If i=95 Then sutun[95]=sutun[0]
Next i
pauseus 10000
return
'****************************************************************
saga_kay:
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto ayar
For I=94 to 0 step -1
    sutun[i]= sutun[i-1]
   If i=0 Then sutun[0]=sutun[95]
Next i
pauseus 10000
return
'****************************************************************
asagi_kay:
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto ayar
for I=0 to 95
   ARA=SUTUN[I]
   z=ARA.7
FOR X=7 to 1 STEP -1
   ARA.0[x]=ARA.0[X-1]
NEXT
   ara.0=Z
   sutun[I]=ARA
next
pauseus 10000
Return
'****************************************************************
yukari_kay:
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto ayar
FOR I=0 to 95
   ARA=SUTUN[I]
   z=ARA.0
FOR X=0 to 6
   ARA.0[X]=ARA.0[X+1]
NEXT
   ARA.7=Z
   SUTUN[I]=ARA
NEXT
pauseus 10000
Return
'****************************************************************
'**************************************************************** 
'***Sensör_Oku***************************************************
SENSOROKU:
           OWOUT   Comm_Pin, 1, [$CC, $44]' ISI değerini oku
Bekle:
'           OWIN    Comm_Pin, 4, [TEMP]    ' Busy değerini oku
'           IF      TEMP = 0 THEN Bekle  ' hala meşgulmü? , evet ise goto Bekle..!
           OWOUT   Comm_Pin, 1, [$CC, $BE]' scratchpad memory oku
           OWIN    Comm_Pin, 2, [HAM.Lowbyte, HAM.Highbyte]' İki byte oku ve okumayı bitir.
           GOSUB   Hesapla
           RETURN
'****************************************************************           
SENSORYAZ:
          OWOUT   COMM_Pin, 1, [$CC, $4E, $00,$00,$31]
          return           
'****************************************************************             
Hesapla:                 ' Ham değerden Santigrat derece hesabı
    Sign  = "+"
    IF SIGN_BITI = NEGAT_ISI THEN
       Sign   = "-" 
       ham=($ffff-ham)+1
    endif
    ISI = Ham*10/16
GEC:
    FLOAT = (ISI //10)
    ISI=ISI/10
    RETURN                     
'****************************************************************
'****************************************************************
'***********Zaman Oku***********
ZAMAN_OKU:
         High RTC_RST
         SHiftOut RTC_DTA, RTC_SCLK, 0, [$BF]
         SHiftIn RTC_DTA, RTC_SCLK, 1, [rtcsec, rtcmin, rtchour,rtcdate , rtcmonth,rtcday,rtcyear, MEM]
         Low RTC_RST
         MEM=rtcsec  : GoSub CEVIR:rtcsec=SAYI 
         MEM=rtcmin  : GoSub CEVIR:rtcmin=SAYI
         MEM=rtchour : GoSub CEVIR:rtchour=SAYI
         MEM=rtcdate : GoSub CEVIR:rtcdate=SAYI
         MEM=rtcmonth: GoSub CEVIR:rtcmonth=SAYI
         MEM=rtcyear : GoSub CEVIR:rtcyear=SAYI
         MEM=rtcday  : GoSub CEVIR: rtcday=SAYI       
         Return
'***********Zaman Yaz***********
ZAMAN_YAZ:
    MEM=rtcsec   : GoSub TERSCEVIR :rtcsec=SAYI
    MEM=rtcmin   : GoSub TERSCEVIR :rtcmin=SAYI
    MEM=rtchour  : GoSub TERSCEVIR :rtchour=SAYI
    MEM=rtcdate  : GoSub TERSCEVIR :rtcdate=SAYI
    MEM=rtcmonth : GoSub TERSCEVIR :rtcmonth=SAYI
    MEM=rtcyear  : GoSub TERSCEVIR :rtcyear=SAYI
    MEM=rtcday   : GoSub TERSCEVIR :rtcday=SAYI
       
    High  RTC_RST
    SHiftOut RTC_DTA, RTC_SCLK, 0, [$8E, 0]
    Low RTC_RST:pause 1
    High RTC_RST         
    SHiftOut  RTC_DTA, RTC_SCLK, 0, [$BE, rtcsec, rtcmin, rtchour,rtcdate , rtcmonth, rtcday, rtcyear, 0]  'YAZ
    Low RTC_RST
    pause 10
Return
'***********Çevir***********               
CEVIR:
    ONLAR=MEM & %01110000
    ONLAR=ONLAR>>4
    BIRLER=MEM & %00001111
    SAYI=ONLAR*10+BIRLER
RETURN 
'***********Ters Çevir***********
TERSCEVIR:               
    ONLAR=MEM DIG 1
    ONLAR=ONLAR<<4
    BIRLER=MEM DIG 0
    SAYI=ONLAR+BIRLER
RETURN   
'****************************************************************   
data_al:
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto ayar
Select Case harf_reg
i=0
if w=1  then  I=I+8 
if w=2  then  I=i+16
if w=3  then  I=i+24
if w=4  then  I=i+32
if w=5  then  I=i+40
if w=6  then  I=i+48
if w=7  then  I=i+56
if w=8  then  I=i+64
if w=9  then  I=i+72
if w=10 then  I=i+80
if w=11 then  I=i+88
if w=12 then  I=i+96
if w=13 then  I=i+104
if w=14 then  I=i+112
if w=15 then  I=i+120
'''''''''''''''''''
Case "A"
for t=0 to 7
lookup t,[$FF,$81,$F6,$F6,$F6,$F6,$81,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "B"
for t=0 to 7
lookup t,[$FF,$80,$B6,$B6,$B6,$B6,$C9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "C"
for t=0 to 7
lookup t,[$FF,$C1,$BE,$BE,$BE,$BE,$DD,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "D"
for t=0 to 7
lookup t,[ $FF,$80,$BE,$BE,$BE,$BE,$C1,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "E"
for t=0 to 7
lookup t,[$FF,$80,$B6,$B6,$B6,$B6,$BE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "F"
for t=0 to 7
lookup t,[ $FF,$80,$F6,$F6,$F6,$F6,$FE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "G"
for t=0 to 7
lookup t,[$FF,$80,$BE,$B6,$B6,$B6,$86,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "H"
for t=0 to 7
lookup t,[$FF,$80,$F7,$F7,$F7,$F7,$80,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "I"
for t=0 to 7
lookup t,[$FF,$BE,$BE,$80,$80,$BE,$BE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "i"
for t=0 to 7
lookup t,[$FF,$BF,$BB,$82,$82,$BB,$BF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
case "J"
for t=0 to 7
lookup t,[$FF,$CE,$BE,$80,$80,$FE,$FE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "K"
for t=0 to 7
lookup t,[$FF,$80,$F7,$EB,$DD,$BE,$FF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "L"
for t=0 to 7
lookup t,[$FF,$80,$BF,$BF,$BF,$BF,$BF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''                       
Case "M"
for t=0 to 7
lookup t,[$FF,$80,$FB,$F7,$F7,$FB,$80,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "N" 
for t=0 to 7
lookup t,[$FF,$80,$FB,$F7,$EF,$DF,$80,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "O"
for t=0 to 7
lookup t,[$FF,$C1,$BE,$BE,$BE,$BE,$C1,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "P"
for t=0 to 7
lookup t,[$FF,$80,$F6,$F6,$F6,$F6,$F9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "R"
for t=0 to 7
lookup t,[$FF,$80,$F6,$E6,$D6,$B6,$B9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "S"
for t=0 to 7
lookup t,[$FF,$D9,$B6,$B6,$B6,$B6,$CD,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "T"
for t=0 to 7
lookup t,[$FF,$FE,$FE,$80,$80,$FE,$FE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "U"                               
for t=0 to 7
lookup t,[$FF,$C0,$BF,$BF,$BF,$BF,$C0,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "V" 
for t=0 to 7
lookup t,[$FF,$E0,$DF,$BF,$BF,$DF,$E0,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "Y"
for t=0 to 7
lookup t,[$FF,$FC,$FB,$87,$87,$FB,$FC,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "Z"
for t=0 to 7
lookup t,[$FF,$9E,$AE,$B6,$BA,$BC,$BE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case " "
for t=0 to 7
lookup t,[$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
End Select
Return
'****************************************************************
data_al2:
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto ayar
Select Case RAKAM
i=0
'SICAKLIK'''''''''''
if A=0  then  i=i+48
if A=1  THEN  I=I+56
if A=2  THEN  I=I+64
if A=3  THEN  I=I+72
if A=4  THEN  I=i+80
if A=5  THEN  I=i+88
if A=6  THEN  I=I+96
if A=7  THEN  I=I+104
if A=8  THEN  I=I+112
if A=9  THEN  I=I+120
if A=10 THEN  I=I+40
if A=11 THEN  I=I+32
'SAAT'''''''''''''''
if w=0  then  I=I+(-16)
if w=1  then  I=i+(-8)
if w=2  then  I=i+16
if w=3  then  I=i+8
if w=4  then  I=i+16
if w=5  then  I=i+40
if w=6  then  I=i+32
if w=7  then  I=i+40
if w=8  then  I=i+(-24)
if w=9  then  I=i+(-32)
if w=10 then  I=i+48
if w=11 then  I=i+56
'TARIH''''''''''''
if B=0  then  I=I+(-16)
if B=1  then  I=i+(-8)
if B=2  then  I=i+(-32)
if B=3  then  I=i+8
if B=4  then  I=i+16
if B=5  then  I=i+(-8)
if B=6  then  I=i+32
if B=7  then  I=I+40
if B=8  then  I=i+48
if B=9  then  I=i+56
if B=10 then  I=i+(-24)
if B=11 then  I=I+(-32)
'''''''''''''''''''
Case 0
for t=0 to 7
lookup t,[$FF,$C1,$80,$A6,$B2,$80,$C1,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 1
for t=0 to 7
lookup t,[$FF,$BF,$BD,$80,$80,$BF,$BF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 2
for t=0 to 7
lookup t,[$FF,$9D,$8C,$A6,$B2,$98,$9D,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 3
for t=0 to 7
lookup t,[$FF,$DD,$9C,$B6,$B6,$80,$C9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 4
for t=0 to 7
lookup t,[$FF,$E7,$E3,$E9,$80,$80,$E7,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 5
for t=0 to 7
lookup t,[$FF,$D8,$98,$BA,$BA,$82,$C6,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 6
for t=0 to 7
lookup t,[$FF,$C3,$81,$B4,$B6,$86,$CF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 7
for t=0 to 7
lookup t,[$FF,$FC,$FC,$8E,$86,$F0,$F8,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 8
for t=0 to 7
lookup t,[$FF,$C9,$80,$B6,$B6,$80,$C9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 9
for t=0 to 7
lookup t,[$FF,$F9,$B0,$B6,$96,$C0,$E1,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case ":"
I=i+ -16     
for t=0 to 7
lookup t,[$FF,$FF,$FF,$99,$99,$FF,$FF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "/"
I=i+32
for t=0 to 7
lookup t,[$FF,$9F,$CF,$E7,$F3,$F9,$FC,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "C"
for t=0 to 7
lookup t,[$FF,$C1,$80,$BE,$BE,$BE,$DD,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
case 223   ' Derece işareti
for t=0 to 7
lookup t,[$FF,$FF,$F9,$F0,$F6,$F0,$F9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
case "-"   
for t=0 to 7
lookup t,[$FF,$E7,$E7,$E7,$E7,$E7,$E7,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''   
Case " "
for t=0 to 7
lookup t,[$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
   
End Select
Return

End

ete

Meyer,
Bana bak demişsin ama bugün meşguldüm. Yalnızca şöyle bir göz atabildim programa. Ancak konsantre olmak gerekiyor ve sen şu anda istim üstündesin. En kolay yine kendin yaparsın diye düşünüyorum.
Aslında benim matrix saat programında çok güzel bir ayar menüsü yapmış idim. Onu inceledinmi? Mutlaka bakmışsındır.
Biraz daha bak istersen o sistemde yapabiliren mükemmel olur.

Tamamen içinden çıkamaz isen ben devreye gireyim.

Ete

meyer

 Cevap yazdığınız için çok teşekkür ederim hocam..
Matrix saat programınızın kodlarını daha önceden  inceleme fırsatını bulmuştum.Dediğiniz gibi çok güzel bir ayar menüsü..Yazdığınız kodları tekrardan inceleyerek  bu sisteme entegre etmeye çalışacağım hocam..En kısa sürede sonuç alıp,paylaşmayı umuyorum...
İyi günler dilerim...

meyer

#28
   Ete Hocam,
Saatin ayar kısmını bir şekilde hallettim gibi  ama stack'de taşma meydana geldi.Kodları inceledim gosub'ları azaltabilir miyim diye ama bu şekliyle zor gibi görünüyor..
-Acaba stack taşmalarından dolayı reset atma sigortasını kapatsak bu sorundan kurtulabilir miyiz ?            STVR = OFF ; Disabled
-Eğer kurtulabiliyor isek; (STVR = OFF ) bunu program içinde nasıl kullanabiliriz ?
Yardımlarınız için şimdiden teşekkür ederim hocam..İyi günler dilerim...


'****************************************************************
'*  Name    : MATRIX_PANO_SAAT_ISI_TARIH_GUN_KAYAN_YAZI.BAS     *
'*  Author  : [HAKAN_ÖZKAN]                                     *
'*  Notice  : Copyright (c) 2011 [select VIEW...EDITOR OPTIONS] *
'*          : All Rights Reserved                               *
'*  Date    : 23.12.2011                                        *
'*  Version : 1.0                                               *
'*  Notes   :                                                   *
'*          :                                                   *
'****************************************************************
define OSC 20
'****************************************************************
TRISB=0 : TRISD=0  : TRISC=15  : TRISE=0 : TRISA=0
PORTB=0 : PORTD=0  : PORTC=0   : PORTE=0 : PORTA=0
INTCON2.7=0
'74HC595*********************************************************
Symbol CLK1     =PORTB.0
Symbol DTA1     =PORTB.1
Symbol STROBE1  =PORTB.2
'DS18B20*********************************************************
SYMBOL COMM_PIN =PORTB.3
'DS1302**********************************************************
symbol  RTC_RST =PORTB.5         'RTC nin bağlandığı portlar
symbol  RTC_SCLK=PORTB.6
symbol  RTC_DTA =PORTB.7
'****************************************************************
NEGAT_ISI CON 1                  ' Negatif_Cold = 1
'****************************************************************
TUS         VAR BYTE
T           VAR Byte
HAM         VAR WORD
ISI         var WORD
rtcsec      VAR BYTE
rtcmin      VAR BYTE
rtchour     VAR BYTE
rtcyear     VAR BYTE
rtcmonth    VAR BYTE
rtcday      VAR BYTE
rtcdate     VAR BYTE
TEMP        VAR BYTE
VERI        VAR BYTE
SAYI        VAR BYTE 
SIGN        VAR BYTE
FLOAT       var BYTE
mem         var byte
BIRLER      VAR BYTE
ONLAR       VAR BYTE
SIGN_BITI VAR HAM.Bit11   '   +/- sıcaklık İşaret biti,  1 = olursa eksi sıcaklık
'****************************************************************
SUTUN     var Byte[8]    ' 1497 adet byte tipinde değişken tanımlanabilir.
RAKAM     VAR BYTE
ARA       VAR BYTE
I         var Byte
X         var Byte
W         var Byte
M         var WORD
'''''''''''''''''''
yazi_reg  var byte
harf_reg  var byte
z         var byte
y         var byte 
A         VAR BYTE
B         VAR BYTE
C         VAR BYTE
'****************************************************************
gosub SENSORYAZ
GOSUB SENSOROKU
'gosub ZAMAN_OKU
Low RTC_RST              ' RTC yi resetle
Low RTC_SCLK
'****************************************************************
clear
pause 250
'****************************************************************
BASLA:
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto TUSAL
yazi_reg=0 
    For W=0 To 11
gosub yazi : yazi_Reg=yazi_reg+1
gosub data_al
aa:
      X=1
      For I=0 To 7
SHiftOut DTA1,CLK1,1,[SUTUN[I+88],SUTUN[I+80],SUTUN[I+72],_
SUTUN[I+64],SUTUN[I+56],SUTUN[I+48],SUTUN[I+40],_
  SUTUN[I+32],SUTUN[I+24],SUTUN[I+16],SUTUN[I+8],SUTUN[I]]
        PORTD=X
        High STROBE1 : pauseus 200 : Low STROBE1
        X=X*2
        pause 3
      Next
     Next
    pause 1
M=M+1
If M<96                Then gosub sola_kay   : goto aa 
If M>96   and m<192    Then gosub saga_kay   : goto aa
If M>192  and m<201    Then gosub asagi_kay  : goto aa
if m>201  and m<210    then gosub yukari_kay : goto aa
If m>210  then m=0
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto TUSAL
goto saat_goster
goto basla
'****************************************************************
TUSAL:
TUS=50
S1:IF PORTC.0=1 THEN TUS=TUS+1      :GOTO S1
S2:IF PORTC.1=1 THEN gosub ILERI_SA :GOTO S2
S3:IF PORTC.2=1 THEN GOsub GERI_SA  :GOTO S3
    IF TUS<>50  THEN T=T+1
    IF T=2      THEN T=0
    IF TUS=2    THEN TUS=0
GOsub SAAT_GOSTER1
    IF PORTC.3=1 THEN GOTO saat_goster 
GOTO TUSAL
'****************************************************************
ILERI_SA:
    IF T=0 AND  PORTC.1=1 THEN RTCHOUR=RTCHOUR+1
    IF T=1 AND  PORTC.1=1 THEN RTCMIN=RTCMIN+1
    IF rtchour=24 THEN rtchour=0 : rtcdate=rtcdate+1 : rtcday=rtcday+1
    IF rtcmin=60 THEN rtcmin=0
gosub zaman_yaz   
GOSUB GECIKME
GOSUB ZAMAN_OKU
return
'****************************************************************
GERI_SA:
    IF T=0 AND  PORTC.2=1 THEN RTCHOUR=RTCHOUR-1
    IF T=1 AND  PORTC.2=1 THEN RTCMIN=RTCMIN-1
    IF rtchour=255 THEN rtchour=23 : rtcdate=rtcdate-1 : rtcday=rtcday-1
    IF rtcmin=255 THEN rtcmin=59
gosub zaman_yaz 
GOSUB GECIKME
GOSUB ZAMAN_OKU
RETURN
'**************************************************************** 
GECIKME:
FOR VERI=0 TO 1800
PAUSEUS 1000
NEXT
RETURN
'****************************************************************
saat_goster1:
    FOR W=0 TO  11
'''''''''''''''''''''
if W=0 then
RAKAM=rtchour DiG 1 
GOSUB DATA_AL2
gosub GOSTER 
endif
'''''''''''''''''''''
if W=1 then
RAKAM=RTCHOUR DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if W=2 then
rakam=":"
gosub data_al2
gosub goster
ENDIF
'''''''''''''''''''''
if W=3 then
RAKAM=RTCmin  DiG 1 
GOSUB data_al2
gosub GOSTER
endif
'''''''''''''''''''''
if W=4 then
RAKAM=RTCMiN  DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if W=5 then
rakam=":"
gosub data_al2
gosub goster
ENDIF
'''''''''''''''''''''
if W=6 then
RAKAM=RTCsec  DiG 1 
GOSUB data_al2
gosub GOSTER
endif
'''''''''''''''''''''
if W=7 then
RAKAM=RTCsec  DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if W=8 OR W=9 OR W=10 OR W=11 then
RAKAM=" " 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
    NEXT
W=0
goto tusal
'**************************************************************** 
saat_goster:
C=C+1
    iF C=20 THEN C=0:  GOTO ISI_GOSTER
'''''''''''''''''''''
GOSUB ZAMAN_OKU
'''''''''''''''''''''
    FOR W=0 TO  11
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto TUSAL
'''''''''''''''''''''
if W=0 then
RAKAM=rtchour DiG 1 
GOSUB DATA_AL2
gosub GOSTER 
endif
'''''''''''''''''''''
if W=1 then
RAKAM=RTCHOUR DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if W=2 then
rakam=":"
gosub data_al2
gosub goster
ENDIF
'''''''''''''''''''''
if W=3 then
RAKAM=RTCmin  DiG 1 
GOSUB data_al2
gosub GOSTER
endif
'''''''''''''''''''''
if W=4 then
RAKAM=RTCMiN  DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if W=5 then
rakam=":"
gosub data_al2
gosub goster
ENDIF
'''''''''''''''''''''
if W=6 then
RAKAM=RTCsec  DiG 1 
GOSUB data_al2
gosub GOSTER
endif
'''''''''''''''''''''
if W=7 then
RAKAM=RTCsec  DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if W=8 OR W=9 OR W=10 OR W=11 then
RAKAM=" " 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
    NEXT
W=0
goto SAAT_GOSTER
'****************************************************************
ISI_GOSTER:
C=C+1
    iF C=20 THEN C=0:  GOTO TARIH_GOSTER
'''''''''''''''''''''
GOSUB SENSOROKU
FOR A=0 TO 11 
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto TUSAL
'''''''''''''''''''''
if a=0 then
RAKAM=ISI DIG 1
GOSUB DATA_AL2
GOSUB GOSTER
endif
'''''''''''''''''''''
if a=1 then
RAKAM=ISI DIG 0
GOSUB DATA_AL2
GOSUB GOSTER
endif
'''''''''''''''''''''
if a=2 then
rakam=223
gosub data_al2
gosub goster
endif
'''''''''''''''
if a=3 then
rakam="C"
gosub data_al2
gosub goster
endif
'''''''''''''''
if sign="-" then
if A=10 then
RAKAM="-" 
GOSUB DATA_AL2
gosub GOSTER
endif
endif
'''''''''''''''
if sign="+" then
if A=4 OR A=5 OR A=6 OR A=7 OR A=8 OR A=9 OR A=10 OR A=11 then
RAKAM=" " 
GOSUB DATA_AL2
gosub GOSTER
endif
endif
'''''''''''''''''''''
NEXT
A=0
GOTO ISI_GOSTER
'****************************************************************
TARIH_GOSTER:
C=C+1
    iF C=15 THEN C=0:  GOTO GUN_GOSTER
'''''''''''''''''''''
GOSUB ZAMAN_OKU
'''''''''''''''''''''
    FOR B=0 TO  11
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto TUSAL
'''''''''''''''''''''
if B=0 then
RAKAM=rtcDAte DiG 1 
GOSUB DATA_AL2
gosub GOSTER 
endif
'''''''''''''''''''''
if B=1 then
RAKAM=RTCdate DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if B=2 then
rakam="/"
gosub data_al2
gosub goster
ENDIF
'''''''''''''''''''''
if B=3 then
RAKAM=RTCmonth  DiG 1 
GOSUB data_al2
gosub GOSTER
endif
'''''''''''''''''''''
if B=4 then
RAKAM=RTCMonth  DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if B=5 then
rakam="/"
gosub data_al2
gosub goster
ENDIF
'''''''''''''''''''''
if B=6 then
RAKAM=RTCyear  DiG 1 
GOSUB data_al2
gosub GOSTER
endif
'''''''''''''''''''''
if B=7 then
RAKAM=RTCyear  DiG 0 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
if B=8  OR B=9 OR B=10 OR B=11 then
RAKAM=" " 
GOSUB DATA_AL2
gosub GOSTER
endif
'''''''''''''''''''''
    NEXT
B=0
goto TARIH_GOSTER
'****************************************************************
GUN_GOSTER:
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto TUSAL
C=C+1
    iF C=5 THEN C=0:  GOTO BASLA
'''''''''''''''''''''
GOSUB ZAMAN_OKU
gosub yazi1
GOSUB GOSTER2
goto GUN_GOSTER
'****************************************************************
GOSTER:
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto TUSAL
      X=1
      For I=0 To 7
SHiftOut DTA1,CLK1,1,[SUTUN[I+88],SUTUN[I+80],SUTUN[I+72],_
SUTUN[I+64],SUTUN[I+56],SUTUN[I+48],SUTUN[I+40],_
  SUTUN[I+32],SUTUN[I+24],SUTUN[I+16],SUTUN[I+8],SUTUN[I]]
        PORTD=X
        High STROBE1 : pauseus 200 : Low STROBE1
        X=X*2
        pause 3
      Next
RETURN
'****************************************************************
GOSTER2:
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto TUSAL
yazi_reg=0 
    For W=0 To 11
gosub yazi1 : yazi_reg=yazi_reg+1
gosub data_al
      X=1
      For I=0 To 7
SHiftOut DTA1,CLK1,1,[SUTUN[I+88],SUTUN[I+80],SUTUN[I+72],_
SUTUN[I+64],SUTUN[I+56],SUTUN[I+48],SUTUN[I+40],_
  SUTUN[I+32],SUTUN[I+24],SUTUN[I+16],SUTUN[I+8],SUTUN[I]]
        PORTD=X
        High STROBE1 : pauseus 200 : Low STROBE1
        X=X*2
        pause 3
      Next
     Next
    pause 1
RETURN
'****************************************************************
yazi:
LookUp yazi_reg,[" ELEKTRONiK "],harf_reg
Return
'****************************************************************
yazi1:
if rtcday=1 then LookUp yazi_reg,["   PAZAR    "],harf_reg
if rtcday=2 then LookUp yazi_reg,[" PAZARTESi  "],harf_reg
if rtcday=3 then LookUp yazi_reg,["    SALI    "],harf_reg
if rtcday=4 then LookUp yazi_reg,["  CARSAMBA  "],harf_reg
if rtcday=5 then LookUp yazi_reg,["  PERSEMBE  "],harf_reg
if rtcday=6 then LookUp yazi_reg,["    CUMA    "],harf_reg
if rtcday=7 then LookUp yazi_reg,[" CUMARTESi  "],harf_reg
Return
'****************************************************************
sola_kay:
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto TUSAL
For I=0 To 94
    sutun[i]= sutun[i+1]
   If i=95 Then sutun[95]=sutun[0]
Next i
pauseus 10000
return
'****************************************************************
saga_kay:
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto TUSAL
For I=94 to 0 step -1
    sutun[i]= sutun[i-1]
   If i=0 Then sutun[0]=sutun[95]
Next i
pauseus 10000
return
'****************************************************************
asagi_kay:
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto TUSAL
for I=0 to 95
   ARA=SUTUN[I]
   z=ARA.7
FOR X=7 to 1 STEP -1
   ARA.0[x]=ARA.0[X-1]
NEXT
   ara.0=Z
   sutun[I]=ARA
next
pauseus 10000
Return
'****************************************************************
yukari_kay:
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto TUSAL
FOR I=0 to 95
   ARA=SUTUN[I]
   z=ARA.0
FOR X=0 to 6
   ARA.0[X]=ARA.0[X+1]
NEXT
   ARA.7=Z
   SUTUN[I]=ARA
NEXT
pauseus 10000
Return
'****************************************************************
'**************************************************************** 
'***Sensör_Oku***************************************************
SENSOROKU:
           OWOUT   Comm_Pin, 1, [$CC, $44]' ISI değerini oku
Bekle:
'           OWIN    Comm_Pin, 4, [TEMP]    ' Busy değerini oku
'           IF      TEMP = 0 THEN Bekle  ' hala meşgulmü? , evet ise goto Bekle..!
           OWOUT   Comm_Pin, 1, [$CC, $BE]' scratchpad memory oku
           OWIN    Comm_Pin, 2, [HAM.Lowbyte, HAM.Highbyte]' İki byte oku ve okumayı bitir.
           GOSUB   Hesapla
           RETURN
'****************************************************************           
SENSORYAZ:
          OWOUT   COMM_Pin, 1, [$CC, $4E, $00,$00,$31]
          return           
'****************************************************************             
Hesapla:                 ' Ham değerden Santigrat derece hesabı
    Sign  = "+"
    IF SIGN_BITI = NEGAT_ISI THEN
       Sign   = "-" 
       ham=($ffff-ham)+1
    endif
    ISI = Ham*10/16
GEC:
    FLOAT = (ISI //10)
    ISI=ISI/10
    RETURN                     
'****************************************************************
'****************************************************************
'***********Zaman Oku***********
ZAMAN_OKU:
         High RTC_RST
         SHiftOut RTC_DTA, RTC_SCLK, 0, [$BF]
         SHiftIn RTC_DTA, RTC_SCLK, 1, [rtcsec, rtcmin, rtchour,rtcdate , rtcmonth,rtcday,rtcyear, MEM]
         Low RTC_RST
         MEM=rtcsec  : GoSub CEVIR:rtcsec=SAYI 
         MEM=rtcmin  : GoSub CEVIR:rtcmin=SAYI
         MEM=rtchour : GoSub CEVIR:rtchour=SAYI
         MEM=rtcdate : GoSub CEVIR:rtcdate=SAYI
         MEM=rtcmonth: GoSub CEVIR:rtcmonth=SAYI
         MEM=rtcyear : GoSub CEVIR:rtcyear=SAYI
         MEM=rtcday  : GoSub CEVIR: rtcday=SAYI       
         Return
'***********Zaman Yaz***********
ZAMAN_YAZ:
    MEM=rtcsec   : GoSub TERSCEVIR :rtcsec=SAYI
    MEM=rtcmin   : GoSub TERSCEVIR :rtcmin=SAYI
    MEM=rtchour  : GoSub TERSCEVIR :rtchour=SAYI
    MEM=rtcdate  : GoSub TERSCEVIR :rtcdate=SAYI
    MEM=rtcmonth : GoSub TERSCEVIR :rtcmonth=SAYI
    MEM=rtcyear  : GoSub TERSCEVIR :rtcyear=SAYI
    MEM=rtcday   : GoSub TERSCEVIR :rtcday=SAYI
       
    High  RTC_RST
    SHiftOut RTC_DTA, RTC_SCLK, 0, [$8E, 0]
    Low RTC_RST:pause 1
    High RTC_RST         
    SHiftOut  RTC_DTA, RTC_SCLK, 0, [$BE, rtcsec, rtcmin, rtchour,rtcdate , rtcmonth, rtcday, rtcyear, 0]  'YAZ
    Low RTC_RST
    pause 10
Return
'***********Çevir***********               
CEVIR:
    ONLAR=MEM & %01110000
    ONLAR=ONLAR>>4
    BIRLER=MEM & %00001111
    SAYI=ONLAR*10+BIRLER
RETURN 
'***********Ters Çevir***********
TERSCEVIR:               
    ONLAR=MEM DIG 1
    ONLAR=ONLAR<<4
    BIRLER=MEM DIG 0
    SAYI=ONLAR+BIRLER
RETURN   
'****************************************************************   
data_al:
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto TUSAL
Select Case harf_reg
i=0
if w=1  then  I=I+8 
if w=2  then  I=i+16
if w=3  then  I=i+24
if w=4  then  I=i+32
if w=5  then  I=i+40
if w=6  then  I=i+48
if w=7  then  I=i+56
if w=8  then  I=i+64
if w=9  then  I=i+72
if w=10 then  I=i+80
if w=11 then  I=i+88
if w=12 then  I=i+96
if w=13 then  I=i+104
if w=14 then  I=i+112
if w=15 then  I=i+120
'''''''''''''''''''
Case "A"
for t=0 to 7
lookup t,[$FF,$81,$F6,$F6,$F6,$F6,$81,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "B"
for t=0 to 7
lookup t,[$FF,$80,$B6,$B6,$B6,$B6,$C9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "C"
for t=0 to 7
lookup t,[$FF,$C1,$BE,$BE,$BE,$BE,$DD,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "D"
for t=0 to 7
lookup t,[ $FF,$80,$BE,$BE,$BE,$BE,$C1,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "E"
for t=0 to 7
lookup t,[$FF,$80,$B6,$B6,$B6,$B6,$BE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "F"
for t=0 to 7
lookup t,[ $FF,$80,$F6,$F6,$F6,$F6,$FE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "G"
for t=0 to 7
lookup t,[$FF,$80,$BE,$B6,$B6,$B6,$86,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "H"
for t=0 to 7
lookup t,[$FF,$80,$F7,$F7,$F7,$F7,$80,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "I"
for t=0 to 7
lookup t,[$FF,$BE,$BE,$80,$80,$BE,$BE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "i"
for t=0 to 7
lookup t,[$FF,$BF,$BB,$82,$82,$BB,$BF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
case "J"
for t=0 to 7
lookup t,[$FF,$CE,$BE,$80,$80,$FE,$FE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "K"
for t=0 to 7
lookup t,[$FF,$80,$F7,$EB,$DD,$BE,$FF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "L"
for t=0 to 7
lookup t,[$FF,$80,$BF,$BF,$BF,$BF,$BF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''                       
Case "M"
for t=0 to 7
lookup t,[$FF,$80,$FB,$F7,$F7,$FB,$80,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "N" 
for t=0 to 7
lookup t,[$FF,$80,$FB,$F7,$EF,$DF,$80,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "O"
for t=0 to 7
lookup t,[$FF,$C1,$BE,$BE,$BE,$BE,$C1,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "P"
for t=0 to 7
lookup t,[$FF,$80,$F6,$F6,$F6,$F6,$F9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "R"
for t=0 to 7
lookup t,[$FF,$80,$F6,$E6,$D6,$B6,$B9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "S"
for t=0 to 7
lookup t,[$FF,$D9,$B6,$B6,$B6,$B6,$CD,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "T"
for t=0 to 7
lookup t,[$FF,$FE,$FE,$80,$80,$FE,$FE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "U"                               
for t=0 to 7
lookup t,[$FF,$C0,$BF,$BF,$BF,$BF,$C0,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "V" 
for t=0 to 7
lookup t,[$FF,$E0,$DF,$BF,$BF,$DF,$E0,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "Y"
for t=0 to 7
lookup t,[$FF,$FC,$FB,$87,$87,$FB,$FC,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "Z"
for t=0 to 7
lookup t,[$FF,$9E,$AE,$B6,$BA,$BC,$BE,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case " "
for t=0 to 7
lookup t,[$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
End Select
Return
'****************************************************************
data_al2:
if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto TUSAL
Select Case RAKAM
i=0
'SICAKLIK'''''''''''
if A=0  then  i=i+48
if A=1  THEN  I=I+56
if A=2  THEN  I=I+64
if A=3  THEN  I=I+72
if A=4  THEN  I=i+80
if A=5  THEN  I=i+88
if A=6  THEN  I=I+96
if A=7  THEN  I=I+104
if A=8  THEN  I=I+112
if A=9  THEN  I=I+120
if A=10 THEN  I=I+40
if A=11 THEN  I=I+32
'SAAT'''''''''''''''
if w=0  then  I=I+(-16)
if w=1  then  I=i+(-8)
if w=2  then  I=i+16
if w=3  then  I=i+8
if w=4  then  I=i+16
if w=5  then  I=i+40
if w=6  then  I=i+32
if w=7  then  I=i+40
if w=8  then  I=i+(-24)
if w=9  then  I=i+(-32)
if w=10 then  I=i+48
if w=11 then  I=i+56
'TARIH''''''''''''
if B=0  then  I=I+(-16)
if B=1  then  I=i+(-8)
if B=2  then  I=i+(-32)
if B=3  then  I=i+8
if B=4  then  I=i+16
if B=5  then  I=i+(-8)
if B=6  then  I=i+32
if B=7  then  I=I+40
if B=8  then  I=i+48
if B=9  then  I=i+56
if B=10 then  I=i+(-24)
if B=11 then  I=I+(-32)
'''''''''''''''''''
Case 0
for t=0 to 7
lookup t,[$FF,$C1,$80,$A6,$B2,$80,$C1,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 1
for t=0 to 7
lookup t,[$FF,$BF,$BD,$80,$80,$BF,$BF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 2
for t=0 to 7
lookup t,[$FF,$9D,$8C,$A6,$B2,$98,$9D,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 3
for t=0 to 7
lookup t,[$FF,$DD,$9C,$B6,$B6,$80,$C9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 4
for t=0 to 7
lookup t,[$FF,$E7,$E3,$E9,$80,$80,$E7,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 5
for t=0 to 7
lookup t,[$FF,$D8,$98,$BA,$BA,$82,$C6,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 6
for t=0 to 7
lookup t,[$FF,$C3,$81,$B4,$B6,$86,$CF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 7
for t=0 to 7
lookup t,[$FF,$FC,$FC,$8E,$86,$F0,$F8,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 8
for t=0 to 7
lookup t,[$FF,$C9,$80,$B6,$B6,$80,$C9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case 9
for t=0 to 7
lookup t,[$FF,$F9,$B0,$B6,$96,$C0,$E1,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case ":"
I=i+ -16     
for t=0 to 7
lookup t,[$FF,$FF,$FF,$99,$99,$FF,$FF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "/"
I=i+32
for t=0 to 7
lookup t,[$FF,$9F,$CF,$E7,$F3,$F9,$FC,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
Case "C"
for t=0 to 7
lookup t,[$FF,$C1,$80,$BE,$BE,$BE,$DD,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
case 223   ' Derece işareti
for t=0 to 7
lookup t,[$FF,$FF,$F9,$F0,$F6,$F0,$F9,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''
case "-"   
for t=0 to 7
lookup t,[$FF,$E7,$E7,$E7,$E7,$E7,$E7,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
'''''''''''''''''''   
Case " "
for t=0 to 7
lookup t,[$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF],Z
  SUTUN[I]=Z
I=I+1
NEXT   
Return
   
End Select
Return

End





ete

#29
Stack taşması tehlikeli bir hatadır. Şu veya bu şekilde önlemeye çalışmamak sorun neyse onu düzeltmek gerekir.
Gün içinde bakacağım programa.

Ete

Programa baktım ve muhtemelen stack taşmasına sebep olan problemi buldum.
Aşağıdaki satır Gosub ile gidilen alt programlara ilave edilmiş ve şartın doğru olması durumunda program Gosub ile geldiği yerden Goto ile ayrılıyor. Bu büyük bir hata . Buna çözüm bulamk zorundasın.

if portc.0=1 or portc.1=1 or portc.2=1 then t=0: goto TUSAL

Satırın anlamını bilemiyorum. Bilmem için epeyce komut takibi yapmam gerek ama sen biliyorsundur umarım.
O satır ne amaçla oraya konuldu. ?
Üstelik aynı satır bir kaç yerde kullanılmış. Yani stack hatası olmaması mümkün değil.
Satırın anlamını açıkla yada kendin bir çözüm bulmaya çalış değilse anlamı üzerindenbirlikte düşünelim.
Çözüm için şunu önerebilirim. Her alt programda bu satır Goto TUSAL yerine GOSUB tusal kullanıp programı ,oradaki işlem bitince tekrar yerine döndürebilirsin. Böylece bütün sorun ortadan kalkar.
 
Ete


Powered by EzPortal