Jim doing something wrong?
! Impossible
.
So, as far as I understand, it works fine… But after you press the [1] button (center the servo) the [0] and [2] buttons don’t work?
Not sure what the issue is, but try and make it print out the address and command for every time it goes through the main loop. Also, isn’t command a hex value? not a dec value? Or you can have a hex value but still use it as a dec?
Another suggest you can try. Instead of making it just an if then statement, try and if elseif statement. make the whole thing a big elseif statement.
Also, could it be possible that so much IR light is coming from the remote that the IRPD is flooded with it and understands it wong?
Try this for the main loop:
main
pulsout 15,servop
pause 20
if(command <> 0xFF) then
serout S_OUT,i115200,"Address = ",hex address," ","Command = ",hex command]
if(command = 0) then
servop = 4000
elseif(command = 1) then
servop = 3000
elseif(command = 2) then
servop = 2000
endif
serout S_OUT,i115200," Servo Pulse = ",dec servop,13]
Command=0xFF
endif
goto main
That might work. Only reason I can think of for why it doesn’t work anymore is that the command the IRPD is getting is not the same as before. Try that out, make sure its connected to PC so it can print out the stuff. I have never tried running a programming in MBasic so sorry if I am wrong about the syntex. I am guessing that serouting 13 to S_OUT prints a \n.
Oh, and uhhh question. What does
command <> 0xFF
do? I forgot what <> means >_<’’