So we are trying to code the robot to do forward from its starting position till it reaches a specific distance from the wall. We are using a MB1040 as the distance sensor. The code, which is attached, for some reason just makes the robot keep going forever forward. The sensor has been tested and it works perfectly. I’m sure I’m probably just missing something really stupid :(. Any help would be much appreciated.
You need a stop for the drive. If you just write a -1 value to the drive it will continue to drive.
Oh wow. I did that for the launcher motors but didn’t do it for the driving ones. Ok thanks! Easy fix