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

Invalid multiplier for microseconds #2

Open
rinkishimo opened this issue Nov 6, 2017 · 0 comments
Open

Invalid multiplier for microseconds #2

rinkishimo opened this issue Nov 6, 2017 · 0 comments

Comments

@rinkishimo
Copy link

hi vinicius,
i usually don't use such a small units, but imho there should be multiplier 1000 if you wanna change microseconds to nanoseconds.

usage delayMicroseconds(4500); // wait min 4.1ms
while delayMicroseconds(int value) means Thread.sleep(0, value*100);
gives me sleep for 450,000 nanoseconds which is 450 microseconds which is only 0.45 miliseconds...

correct sleep should be something like
Thread.sleep(value / 1000, (value % 1000) * 1000);

anyway, maybe it's not big deal as it works for me with 100 on rpi 3 just fine. or i'm just missing something ;)

miro (rinkishimo)

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