How can I make a code that can slow down my robot with the press of a button

I could use some help with this since this is my first year if V5 as a middle schooler.

Clumsy way to do it:
Replace spin() in your driver control code with code that changes the value of a variable and changes the speed for each situation
(Sorry on mobile can’t type now)

1 Like

Great, thank you so much, will test later today.

what code language do you use. we have this for lining up our lady brown in c++