Skip to content

Library is very slow #4

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

Open
L0laapk3 opened this issue Nov 28, 2017 · 5 comments
Open

Library is very slow #4

L0laapk3 opened this issue Nov 28, 2017 · 5 comments

Comments

@L0laapk3
Copy link

If you have a robot, use for example, the following code while driving:

leftMotor.setmotor(_CCW, 0); rightMotor.setmotor(_CCW, 0);
The robot will turn the left wheel off first, then delay, and then the right wheel, causing the robot to turn 10-20 degrees left.

This is caused by


Is there a reason that this delay is here? Whatever the reason is, blocking the entire code for 100 ms is not the solution. I highly recommend removing the delay, it is not appropriate. If there are I²C problems, these must be solved in a different way than this.

@fredericplante
Copy link

Have you tryed to run without it?

@L0laapk3
Copy link
Author

I have, and it works, but I would like to see this addressed in the right library.

@L0laapk3
Copy link
Author

L0laapk3 commented Jan 10, 2018

#5

@fredericplante
Copy link

Might be smart to let a yield(); take the place.

@oleglyan
Copy link

I removed delays

and controll my PS4 BT remote robot in this manner

if(millis()- TmStmpMtrCtrlOld >10){
M_R->setmotor( _CW, oldR2Value>0? (oldR2Value/3+15):0);
M_L->setmotor( _CW, oldL2Value>0? (oldL2Value/3+15):0);
TmStmpMtrCtrlOld=millis();
}

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

3 participants