How could I mid match reverse the direction my drivetrain motors are spinning.
(Im using Blocks code Btw)
By reverse do you mean drive backwards? If so you can just configure that in the devices tab under controller. If you have a 6 motor drive I don’t think that will work so you would have to set the left velocity to the controller’s fwd axis + the horizontal axis value. Then set the right velocities to fwd axis - horizontal axis. Then you would just spin all the motors at that velocity.
If you mean change the toggle switch when configuring motors from forwards to revered like this:
Then that would be more complicated.
As far as I know there is no direct way to change this in the code (maybe with text but not blocks). One thing you could do is just tell the motors to spin reversed? I’m not sure the purpose so more information would be useful.
If you want to change it in real time with another button then you could just multiply the motor velocity by -1. Hope this helps but it’s hard to provide assistance when you don’t tell us what it’s for.
When I first started this season I was also using blocks and wanted to do the same thing you are talking about (I think). This is what I came up with and it worked very well for my six motor drivetrain.
You could simplify this even more and instead of checking the drive value when b is pressed, just multiply it by -1. Then in the driver loop, set the velocity to the controller axis value * the drive variable and remove all the if statements.