IR remote and servos
chris jones
Posts: 391
Hello,
i am trying to get my servos to work with my IR remote when i click volum up it moves to the right and volume down to the left but my if statement seems to always run right .
CODE ATTACHED
i am trying to get my servos to work with my IR remote when i click volum up it moves to the right and volume down to the left but my if statement seems to always run right .
CODE ATTACHED
repeat 'main loop code := Get_IR_Code(IR_PIN, THRESHOLD_CNT) if code > 0 pc.hex(code,4) pc.char(" ") '' pc.bin(code,32) pc.char(13) if code == 0127 servo.Set(1, 40) ' Set servo to approximately -45° time.Pause(1000) servo.Disable(1) ' Stop servo si if code == 0125 servo.Set(1, -40) ' Set servo to approximately -45° time.Pause(1000) servo.Disable(1) ' Stop servo si
Comments