I’m currently trying to program autonomous, I’m struggling to find a way to make our robot move at the same time as it’s intake is running. My problem is that the programs runs separately (I want it to move and intake but it either just moves or just intakes and does the other). Here’s the program I have it at:
That looks fine to me, time is a parameter passed to the function that line is in, uint_32(time) casts time to an unsigned 32-bit integer. I don’t think that’s strictly necessary but it shouldn’t break anything either.
void Intake(int time){
LeftClaw.rotateFor(fwd, time, sec, 60, pct);
RightClaw.rotateFor(fwd, time, sec, 60, pct);
//Rotate without yielding your current thread
}
void autonomous( void ) {
Intake(5); // Start the intake before the drive since the drive yields.
DriveFoward(100);
}