4

I saw an program on the Lego Education page which makes a Lego Mindstorms EV3 robot gradually slow down as it approaches a wall. The info from the proximity sensor is used as the direct wire input of the Move Steering block, the nearer the robot to the wall, the slower the speed of the robot.

The problem is that my infrared sensor is on the rear of my robot (track3r). I would like to make the input to the Move Steering Block negative so that my robot motor moves backwards (in reverse) using this program. How do I do this? I can't make the output of the proximity sensor negative... can I?

1 Answer 1

5

Multiply the output of the proximity sensor by -1.

3
  • Aha, use (data wire it) the math block to multiply the output of the proximity sensor by -1 then feed it back (data wire it) to the steering block. Appreciate your time.
    – gurble
    Commented Nov 27, 2017 at 23:21
  • Actually, using the Invert Motor (blue) block from the Advanced Palette before the motor would probably have the same effect. I just read about it The Art of Lego Mindstorms EV3 Programming by Terry Griffin. The Invert Motor block reverses the meaning of the Power parameter for the motor connected to the selected Port.
    – gurble
    Commented Dec 15, 2017 at 6:27
  • Unfortunately, the Invert Motor block doesn't work with Move Steering or Move Tank blocks. Commented Dec 15, 2017 at 15:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.