Witam.
Mam mały problem. Próbuję zrobić programik, w którym miga 5 led a gdy wcisnę guzik, zatrzymuje się na tej Led co świeci.
Napisałem programik. Led migają tak jak chcę ale nie zatrzymują się po naciśnięciu przycisku.
Mam mały problem. Próbuję zrobić programik, w którym miga 5 led a gdy wcisnę guzik, zatrzymuje się na tej Led co świeci.
Napisałem programik. Led migają tak jak chcę ale nie zatrzymują się po naciśnięciu przycisku.
$regfile = "attiny2313.dat"
$crystal = 4000000
Config Portb = Input
Portb = &B00000000
Config Portd = Output
Portd = &B0000000
Do
If Portd.0 = 1 And Pinb.0 = 1 Then
Portd.0 = 1
End If
If Portd.1 = 1 And Pinb.0 = 1 Then
Portd.1 = 1
End If
If Portd.2 = 1 And Pinb.0 = 1 Then
Portd.2 = 1
End If
If Portd.3 = 1 And Pinb.0 = 1 Then
Portd.3 = 1
End If
If Portd.4 = 1 And Pinb.0 = 1 Then
Portd.4 = 1
End If
If Portd.5 = 1 And Pinb.0 = 1 Then
Portd.5 = 1
End If
Wait 1
Portd.0 = 1
Wait 1
Portd.0 = 0
Portd.1 = 1
Wait 1
Portd.1 = 0
Portd.2 = 1
Wait 1
Portd.2 = 0
Portd.3 = 1
Wait 1
Portd.3 = 0
Portd.4 = 1
Wait 1
Portd.4 = 0
Portd.5 = 1
Wait 1
Portd.5 = 0
Loop
End