Hi Forum Goers,
I have a quick question regarding a VCS coding issue: how do I code a toggle button so that the drive train controls reverse when pressed? Hopefully that makes sense. Here’s what I have now, but it’s not working properly, as the toggle button will never switch. Hope you can help!
bool ClawIsFront = false;
while (ClawIsFront == false)
{
lift(); /////lift control method
intake(); ////intake control method
drive(); //////regular drive controls
}
if (Controller2.ButtonA.pressing())
{
ClawIsFront = !ClawIsFront;
}
while (ClawIsFront == true)
{
lift();
intake();
flipdrive(); /////REVERSED driving controls
}