Hello. I hope everyone’s season of Vex Robotics is going well. We are currently working on a new robot and the chassis is too fast for some conditions when competing in Tipping Point. I am wanting to make a program that changes the chassis speed between 50% and 100%. I want to change between the preset speeds when I press button B on Controller 1. My understanding of this is that I need to use a bool (Boolean) as a two-value variable. Then I would set one of the bool values to one of the chassis speeds and vice versa. For example, when bool == 1, chassis =100%. When bool == 0, 50% = chassis speed. A resource I have been using is W3SCHOOLS. I provided the link below. I also provided an image of our code as a visual guide. When I ran the code that I have written, the robot only drives at 50% and is unable to switch back and forth between the two speed settings. If anyone has any ideas on how to fix this issue and is willing to share the knowledge, that would be greatly appreciated. Good luck in Tipping Point
outside of the while loop (before it, inside main). That call registers the event handler called Chassis_Speed, by placing it inside the loop you register multiple copies which will conflict.
you are using controller.axis3.value() which is a value between -127 and 127 it might be easier to use .position(percent) for understanding what is going on