głowie sie już z tym od paru dni i nic próbowałem dużo ale nie wychodzi chodzi mi o przycisk który by zwiększał minuty
może trzeba jakąś inna instrukcje użyć ?? za wszelka pomoc dziękuje
tak wygląda program
może trzeba jakąś inna instrukcje użyć ?? za wszelka pomoc dziękuje
if pinb.4=0 then
incr setki
end if tak wygląda program
$regfile = "attiny2313.dat"
$crystal = 1000000
Config Pinb.0 = Output : Reset Portb.0
Config Pinb.1 = Output : Reset Portb.1
Config Pinb.2 = Output : Reset Portb.2
Config Pinb.3 = Output : Reset Portb.3
Config Pinb.4 = Input : Set Portb.4
Config Pinb.5 = Output : Reset Portb.5
'
Config Portd = Output
Dim Jedn As Byte
Dim Dzies As Byte
Dim Setki As Byte
Dim Tys As Byte
Dim Ktorywys As Byte
Enable Timer0
Enable Interrupts
Config Timer0 = Timer , Prescale = 8
On Timer0 Wysw
Do
If Pinb.1 = 1 Then
Waitms 1000
Incr Jedn
If Jedn = 10 Then
Jedn = 0
Incr Dzies
If Dzies = 10 Then
Dzies = 0
Incr Setki
If Setki = 10 Then
Setki = 0
Incr Tys
If Tys = 10 Then
Tys = 0
End If
End If
End If
End If
End If
Loop
End
Tabela:
Data 130 , 222 , 168 , 140 , 212 , 133 , 129 , 158 , 128 , 132
Wysw:
Timer0 = 133
Portb = &B00010000
Incr Ktorywys
If Ktorywys = 4 Then
Ktorywys = 0
End If
Select Case Ktorywys
Case 0:
Portd = Lookup(jedn , Tabela)
Portb.1 = 1
Case 1:
Portd = Lookup(dzies , Tabela)
Portb.5 = 1
Case 2:
Portd = Lookup(setki , Tabela)
Portb.3 = 1
Case 3:
Portd = Lookup(tys , Tabela)
Portb.0 = 1
End Select
Return