Robot Moves by itself with a controller program


#1

How would you set up a threshold system like you can in ROBOTC in Modkit. When you have a driver control program sometimes the robots move by them selves. In ROBOT C you can set the throttle threshold to 10 so it will not move until the joystick is past the value of 10, preventing the robot from moving by itself.


#2

Hey Mr. Biggs~

I do this all the time! You just need to nest operators -
the green blocks. You’ll find that they are all oval in shape, so they can be used as values within one another.

This is my quickest / easiest method:

FOREVER
IF joystick A is < 10 AND joysick A is > -10
Set velocity to 0
Else, set velocity to Jotstick A, spin forward.

Since the joystick values range from -100 to 100, a forward velocity of, say, negative 25 would be the same as spinning in reverse at 25 rpms. Forward and reverse handled in just a few blocks!

All that remains is tweaking the threshold values within the first IF.

(Let me know if you need a screenshot, and I can probably post one tomorrow (Friday).

Happy coding and best of luck!

~Vexatron


#3

Screenshot attached.

~Vexatron

f5fe85575da1c6670832cece6f20f470.png


#4

Awesome thank you.