Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4654

MicroPython • Timing Various Events

$
0
0
Hi,
I'm looking for the most reliable accurate way to measure time between input pins chaging state between high and low with an accuracy of about +/- 100ms. The duration of the times could be a few seconds to a few weeks. In C/C++ I would use system ticks for this, but from what I've read about time.ticks_ms() in micropython this may not a good accurate choice. I was looking at using time.time_ns() whcih would give microseconds since Epoch. This is a little bit over kill but could work, but the docs say there could be implications to the heap. Any input on the best way to do this would be appreciated. Thanks.

Statistics: Posted by ww9317 — Tue Jan 16, 2024 12:12 am — Replies 1 — Views 508



Viewing all articles
Browse latest Browse all 4654

Trending Articles