Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arcadeDrive requires multiple calls #17

Open
ajlewis02 opened this issue Jul 16, 2024 · 0 comments
Open

arcadeDrive requires multiple calls #17

ajlewis02 opened this issue Jul 16, 2024 · 0 comments

Comments

@ajlewis02
Copy link
Contributor

drivetrain.arcadeDrive() doesn't seem to correctly set all motors unless it's called multiple times in a row.

Originally, I thought this issue had to do with calling delay() after a call to arcadeDrive() - but, the issue seems to be more correlated to whether there are multiple arcadeDrive() calls. (It's likely that it only appeared to have to do with the delay() call because, under other circumstances, arcadeDrive() is called multiple times because the loop function is called multiple times.)

This issue is most easily observed when writing an auto mode, because some auto mode implementations perform the entire auto mode with only one call of the loop function.

Within a single call of the loop function the pattern:

drivetrain.arcadeDrive(-1, 0);
delay(1000);

doesn't set all motors. Its behavior varies between runs - sometimes, three motors are set, and sometimes two motors are set.

However, if the above block of code is run twice in a row (such as by holding down the "auto begin" button), all motors are correctly set on the second run.

These patterns both work as expected:

drivetrain.arcadeDrive(-1,0);
drivetrain.arcadeDrive(-1,0);
delay(1000);
drivetrain.arcadeDrive(0,0);
drivetrain.arcadeDrive(-1,0);
delay(1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant