SwingeyP
Member
Pic 16F876A
Can anyone please tell me what im doing wrong here in pic basic.
Symbol leg1servo1 = PORTB.7 'J3 - Pin 28'
Symbol leg2servo1 = PORTB.4 'J6 - Pin 25'
Symbol leg3servo1 = PORTB.1 'J9 - Pin 22'
Symbol leg4servo1 = PORTA.4 'J12 - Pin 6'
Config RA0 = Input
Config RA1 = Input
Config RA2 = Input
Config RA3 = Input
Config RA4 = Output
Config PORTB = Output
Config PORTC = Output
start:
If RA0 = 1 Then
Goto stop
Endif
ServoOut leg1servo1, 10
ServoOut leg2servo1, 10
ServoOut leg3servo1, 10
ServoOut leg4servo1, 10
Goto start
stop:
End
I am trying this on the oshon simulator with a 4 button extra given to me by Eric - a forum user. I just can't get any of the inputs to trigger either in simulation or for real.
I must be doing something stupid. I have tried both states it sees logic 0 but never logic 1 why?
Regards - Paul
Can anyone please tell me what im doing wrong here in pic basic.
Symbol leg1servo1 = PORTB.7 'J3 - Pin 28'
Symbol leg2servo1 = PORTB.4 'J6 - Pin 25'
Symbol leg3servo1 = PORTB.1 'J9 - Pin 22'
Symbol leg4servo1 = PORTA.4 'J12 - Pin 6'
Config RA0 = Input
Config RA1 = Input
Config RA2 = Input
Config RA3 = Input
Config RA4 = Output
Config PORTB = Output
Config PORTC = Output
start:
If RA0 = 1 Then
Goto stop
Endif
ServoOut leg1servo1, 10
ServoOut leg2servo1, 10
ServoOut leg3servo1, 10
ServoOut leg4servo1, 10
Goto start
stop:
End
I am trying this on the oshon simulator with a 4 button extra given to me by Eric - a forum user. I just can't get any of the inputs to trigger either in simulation or for real.
I must be doing something stupid. I have tried both states it sees logic 0 but never logic 1 why?
Regards - Paul