Hi there this is my first real bit of codeing for pic basic pro.
Can some one please look over it for me and see if there are any mistakes or have any advice regarding it thank you
The idea of the code is to control two pwm signals and output the result for a servo.
When input one is in use it will control the output but when not in use ie in the neutral position of 1.5ms pulses then input 2 controls the output.
when here is the code
'servo control prog
'set variables
ch1 var byte
ch2 var byte
s1 = 150
start:
if ch1 < s1 then output1
if ch1 > s1 then output1
if ch1 = s1 then output2
output1:
pulsout portb.3,ch1
pause 18
goto start
output2:
pulsout portb.3,ch2
pause 18
goto start
end
Bookmarks