Witam!
Posiadam schemat pilota rc5 (poniżej)
Staram się to wszystko oprogramować. Program znajduję się poniżej i powiedzcie mi dlaczego to nie działa??
Już nie wiem jak sobie z tym poradzić
Proszę o pomoc!
Z góry dziękuję!
Pozdrawiam!
Posiadam schemat pilota rc5 (poniżej)
Staram się to wszystko oprogramować. Program znajduję się poniżej i powiedzcie mi dlaczego to nie działa??
'****Program na ATtiny2313****'
'*** Program pod pilot RC5****'
$regfile = "attiny2313.dat"
$crystal = 4000000
Config Pind.0 = Input : Portd.0 = 0
Config Pind.1 = Input : Portd.1 = 0
Config Pind.2 = Input : Portb.2 = 0
Config Pind.3 = Input : Portb.3 = 0
Config Pind.4 = Input : Portb.4 = 0
Config Pinb.3 = Output : Portb.3 = 0
Dim Togbit As Byte , Command As Byte , Address As Byte
Do
Debounce Pind.0 , 1 , P1 , Sub
Debounce Pind.1 , 1 , P2 , Sub
Debounce Pind.2 , 1 , P3 , Sub
Debounce Pind.3 , 1 , P4 , Sub
Debounce Pind.4 , 1 , P5 , Sub
Loop
End
P1:
Command = 1
Togbit = 0
Address = 1
Do
Waitms 500
Rc5send Togbit , Address , Command
Loop Until Pind.0 = 0
Return
P2:
Command = 2
Togbit = 0
Address = 1
Do
Waitms 500
Rc5send Togbit , Address , Command
Loop Until Pind.1 = 0
Return
P3:
Command = 3
Togbit = 0
Address = 1
Do
Waitms 500
Rc5send Togbit , Address , Command
Loop Until Pind.2 = 0
Return
P4:
Command = 4
Togbit = 0
Address = 1
Do
Waitms 500
Rc5send Togbit , Address , Command
Loop Until Pind.3 = 0
Return
P5:
Command = 5
Togbit = 0
Address = 1
Do
Waitms 500
Rc5send Togbit , Address , Command
Loop Until Pind.4 = 0
Return
Proszę o pomoc!
Z góry dziękuję!
Pozdrawiam!