time.sleep() accuracy #14444
Unanswered
Dandy-Don
asked this question in
RP2040 / Pico
Replies: 2 comments 6 replies
-
I wonder if the loop below ever terminates, since XOR is a Pin object, which always evaluates to True.
Instead of using time.sleep(0.01) you could try time.sleep_ms(10). |
Beta Was this translation helpful? Give feedback.
5 replies
-
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, everyone!
I am having trouble getting good delays out of my Pico using Micropython v1.20....
The code is simple. Just checking a pin to see when it gets pulled to ground. Then set another pin low, delay for a few milliseconds, then set that pin high again.
When I run this I get crazy results. The last
time.sleep(0.01)
delay never gives me the same delay twice. I get mixed results...I tried using an interrupt handler to see if that helps, but nothing changed.
Suggestions? Any help will be greatly appreciated!
--Don
Beta Was this translation helpful? Give feedback.
All reactions