Hi
I am looking for any ideas about why my 08M is giving me the wrong outputs.
I want the 08M to respond to a 2 bit input (connected to pins 3 and 4) and output a corresponding servo command.
The problem is that the first command in the loop doesn't work. I have re-arranged the code a number of times and the first servo command always gives the wrong output.
Here is my code:
main:
if pin3 = 0 and pin4 = 0 then
low 1
pause 12
elseif pin3 = 1 and pin4 = 1 then
low 1
pause 12
servo 1, 122 'reverse slow
elseif pin3 = 0 and pin4 = 1 then
low 1
pause 12
servo 1, 105 'forwards fast
elseif pin3 = 1 and pin4 = 0 then
low 1
pause 12
servo 1, 118 'forwards slow
endif
goto main
All outputs work when the corresponding input is applied, except the first one which will output a pulse of about 500 microseconds every 16ms.
I have tried another chip with the same results so it must be in the code.
The 12ms pause is necessary to prevent what appear to be overlapping signals.
Any help would be great.
Thanks
Mike
I am looking for any ideas about why my 08M is giving me the wrong outputs.
I want the 08M to respond to a 2 bit input (connected to pins 3 and 4) and output a corresponding servo command.
The problem is that the first command in the loop doesn't work. I have re-arranged the code a number of times and the first servo command always gives the wrong output.
Here is my code:
main:
if pin3 = 0 and pin4 = 0 then
low 1
pause 12
elseif pin3 = 1 and pin4 = 1 then
low 1
pause 12
servo 1, 122 'reverse slow
elseif pin3 = 0 and pin4 = 1 then
low 1
pause 12
servo 1, 105 'forwards fast
elseif pin3 = 1 and pin4 = 0 then
low 1
pause 12
servo 1, 118 'forwards slow
endif
goto main
All outputs work when the corresponding input is applied, except the first one which will output a pulse of about 500 microseconds every 16ms.
I have tried another chip with the same results so it must be in the code.
The 12ms pause is necessary to prevent what appear to be overlapping signals.
Any help would be great.
Thanks
Mike
Last edited: