Motor Lock for center platform

I am on 80H and we are trying to make a code that would lock/ hold the motors on the middle platform. We are able to lock it but we are not able to unlock it what so ever. What code can we use? Are there any suggestions.

you could try a hold braketype while the joysticks are nuetral

Please post the relevant code- particularly your main/usercontrol loop and any relevant functions that are called. Do you ever set brakeType to coast?

Here, I’ve got some pseudocode, if that helps:

set Drive=1
if (button A is pressed) {
if (Drive==1){
Driveleft hold
Driveright hold
set Drive=0
}
else{
if (Drive==0){
Driveleft coast
Driveright coast
set Drive=0
}
}

Just put this in your code somewhere, you’ll be all set. Basically what is when you’re pressing button A the drive holds, and when you’re not, it coasts. Just hold down button A once you get on the platform. Hope this works!

Is this a template code for c++ or is it just ready to use.

Never mind I just saw the pseudo code part

For v5: make a button that when pressed applies brakeType:brake to all drive motors.

For 393: use encoders or potentiometers that are read and try and counteract motor movement/drift when a button is pressed (never tried this but it worked on a DR4B last year)

We finally made the motor lock work thank you very much

For v5: make a button that when pressed applies brakeType:brake to all drive motors.

Just in general, it seems to be better to use hold type especially when on the center platform. Brake type doesn’t use PID, it just tries to brake it by applying electric current. I suppose there are applications for it; maybe you’ve got some. :smiley:

2 Likes