I do not know what the issue is with my auton when raising my lift. Help is needed. When using the user control, the lift works beautifully, the only problem is in the auton.
This is the auton I’m trying to run.
void autonomous( void )
Is it raising at all? Do you have one of the motors reversed in the set up?
And you may want to brake instead of setting it to zero. You can either set it to coast which would conserve space and be faster to type or you could brake to help with the arm staying up.
I would not use T for both functions
In OP’s auton they’re only doing one function so I don’t think overlapping variables would be the problem.
@Chuy are you sure liftUp makes the lift go up and not down and liftDown doesn’t make it go up? I don’t know, just a couple of mistakes I’ve made in the past. If it works beautifully in driver could you send a picture of your user control to compare?
Shouldn’t this be task autonomous ( )?
Why not? the variable is scoped inside the function.
The left side seems to try to raise but gives up after like half a second, no matter how much time or revolutions I set it to. And I already prepared the brakes, but I just wanted to get the lift done beforehand. I am fairly sure the lift does go up with liftUp.
I don’t think so, I’ve used this same template for a few months now and it works.
Try to use a start rotate command instead
You are using ‘Non-Blocking Code’ this means that it will do everything in the brackets at practically the same time. You need to use “startRotate”, and use "startRotate(…,false); for the first line, and startRotate(); for the second line.
Nah he shouldn’t have to, I used to program like this all the time. The time separates it from the one that’s stopping it so it should raise for however long t is then stop.
@Chuy try setting LiftR’s directionType as rev and then see if that works because it sound like it’s trying to lift but it’s fighting itself, I don’t know what else the issue could be.
I retried the code in my picture today, and it worked. I assume that it was a glitch or something but thank you all, I really do appreciate the help. I will try some of the tips you’ve shared.