پاسخ : ذخیره عدد در بسکام؟
حالا هیچ راهی نیست که مدام برای چند تا متغییر هی نگیم reed , write ؟؟؟
با همون دستور eram ??
حالا هیچ راهی نیست که مدام برای چند تا متغییر هی نگیم reed , write ؟؟؟
با همون دستور eram ??
[FONT=Yekan]Config Adc = Single , Prescaler = Auto , Reference = Avcc[/FONT]
Start Adc
Config Portb = Input
Config Portd = Output
Dim A As Long
Dim B As Long
Dim H As Byte
Dim L As Byte
Cursor Off
Cls
Asli:
Do
Readeeprom H , 0
Readeeprom L , 1
Gosub Daryaft_dama
Gosub Namayesh_dama
Gosub Namayesh_l
Gosub Namayesh_h
Debounce Pinb.0 , 1 , Afzayesh_h , Sub
Debounce Pinb.1 , 1 , Kahesh_h , Sub
Debounce Pinb.2 , 1 , Afzayesh_l , Sub
Debounce Pinb.3 , 1 , Kahesh_l , Sub
Debounce Pinb.4 , 1 , Clear_lcd , Sub
If B => H Then Goto H_bala
If B <= L Then Goto L_payin
If B < H Then Goto H_payin
If B > L Then Goto L_bala
Loop
Daryaft_dama:
A = Getadc(0)
B = A / 10
Return
Namayesh_dama:
Locate 1 , 1
Lcd "Temp=" ; B ; " C"
Return
Namayesh_l:
Locate 2 , 1
Lcd "L=" ; L ; " C"
Return
Namayesh_h:
Locate 2 , 8
Lcd "H=" ; H ; " C"
Return
Afzayesh_h:
Incr H
Writeeeprom H , 0
Waitms 10
Return
Kahesh_h:
Decr H
Writeeeprom H , 0
Waitms 10
Return
Afzayesh_l:
Incr L
Writeeeprom L , 1
Waitms 10
Return
Kahesh_l:
Decr L
Writeeeprom L , 1
Waitms 10
Return
H_bala:
Set Portd.0
Goto Asli
H_payin:
Reset Portd.0
Goto Asli
L_bala:
Reset Portd.0
Goto Asli
L_payin:
Set Portd.0
Goto Asli
Clear_lcd:
Cls
Return
[FONT=Yekan]End[/FONT]
[FONT=Yekan]Config Adc = Single , Prescaler = Auto , Reference = Avcc[/FONT]
Start Adc
Config Portb = Input
Config Portd = Output
Dim A As Long
Dim B As Long
Dim C As Eram Byte
Dim D As Eram Byte
Dim H As Byte
Dim L As Byte
C = H
D = L
Cursor Off
Cls
Asli:
Do
Gosub Daryaft_dama
Gosub Namayesh_dama
Gosub Namayesh_l
Gosub Namayesh_h
Debounce Pinb.0 , 1 , Afzayesh_h , Sub
Debounce Pinb.1 , 1 , Kahesh_h , Sub
Debounce Pinb.2 , 1 , Afzayesh_l , Sub
Debounce Pinb.3 , 1 , Kahesh_l , Sub
Debounce Pinb.4 , 1 , Clear_lcd , Sub
If B => H Then Goto H_bala
If B <= L Then Goto L_payin
If B < H Then Goto H_payin
If B > L Then Goto L_bala
Loop
Daryaft_dama:
A = Getadc(0)
B = A / 2
Return
Namayesh_dama:
Locate 1 , 1
Lcd "Temp=" ; B ; " C"
Return
Namayesh_l:
Locate 2 , 1
Lcd "L=" ; L ; " C"
Return
Namayesh_h:
Locate 2 , 8
Lcd "H=" ; H ; " C"
Return
Afzayesh_h:
Incr H
H = C
Return
Kahesh_h:
Decr H
H = C
Return
Afzayesh_l:
Incr L
L = D
Return
Kahesh_l:
Decr L
L = D
Return
H_bala:
Set Portd.0
Goto Asli
H_payin:
Reset Portd.0
Goto Asli
L_bala:
Reset Portd.0
Goto Asli
L_payin:
Set Portd.0
Goto Asli
Clear_lcd:
Cls
Return
[FONT=Yekan]End[/FONT]
[FONT=Yekan]Config Adc = Single , Prescaler = Auto , Reference = Avcc[/FONT]
Start Adc
Config Portb = Input
Config Portd = Output
Dim A As Long
Dim B As Long
Dim C As Eram Byte
Dim D As Eram Byte
Dim H As Byte
Dim L As Byte
H = C
L = D
Cursor Off
Cls
Asli:
Do
Gosub Daryaft_dama
Gosub Namayesh_dama
Gosub Namayesh_l
Gosub Namayesh_h
Debounce Pinb.0 , 1 , Afzayesh_h , Sub
Debounce Pinb.1 , 1 , Kahesh_h , Sub
Debounce Pinb.2 , 1 , Afzayesh_l , Sub
Debounce Pinb.3 , 1 , Kahesh_l , Sub
Debounce Pinb.4 , 1 , Clear_lcd , Sub
If B => H Then Goto H_bala
If B <= L Then Goto L_payin
If B < H Then Goto H_payin
If B > L Then Goto L_bala
Loop
Daryaft_dama:
A = Getadc(0)
B = A / 2
Return
Namayesh_dama:
Locate 1 , 1
Lcd "Temp=" ; B ; " C"
Return
Namayesh_l:
Locate 2 , 1
Lcd "L=" ; L ; " C"
Return
Namayesh_h:
Locate 2 , 8
Lcd "H=" ; H ; " C"
Return
Afzayesh_h:
Incr H
C = H
Waitms 10
Return
Kahesh_h:
Decr H
C = H
Waitms 10
Return
Afzayesh_l:
Incr L
D = L
Waitms 10
Return
Kahesh_l:
Decr L
D = L
Waitms 10
Return
H_bala:
Set Portd.0
Goto Asli
H_payin:
Reset Portd.0
Goto Asli
L_bala:
Reset Portd.0
Goto Asli
L_payin:
Set Portd.0
Goto Asli
Clear_lcd:
Cls
Return
[FONT=Yekan]End[/FONT]
دیدگاه