Timer objects
-
Im working with a LoPy and Im trying to control an ultrasonic distance sensor. Distance measurement is done be measuring time difference in the ultrasonic echo signal. To implement this propery some kind of timer facility would be very handy. Where is the right place to put feature requests?
Nice to have:
- Timer objects like those done by the guys over at pyboard https://docs.micropython.org/en/latest/pyboard/library/pyb.Timer.html
- Currently there is only a ticks_ms() method in the time module. Are there any plans to fully fullfill the https://docs.micropython.org/en/latest/pyboard/library/time.html interface for the time module. Particularly the ticks_us() and the ticks_diff() functions would be very handy.
- To take full advante of the deepsleep mode, an RTC irq/wakeup would be very nice. The spec of the board says, that there is an RTC built-in.
Thanks & Cheers
Chris -
@cfaessler Timer support should be added soon... hopefully by next Friday as originally announced.
-
Hi Chris,
How did you get on with your ultrasonic sensor? I'm just starting out.
Cheers,
-
-
I don't think the Timer class is supported by the Espressif IDF.... yet..
-
@Ralph Does RTC work on Lopy with latest firmware or not?
Example:
rtc = machine.RTC()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'RTC'Thanks,..
-
Hi @microman7k,
We are still updating our documentation to reflect which features are already implemented and which aren't. Please check: https://docs.pycom.io/pycom_esp32/library/machine.html
There's no
RTCthere so that means that it's not implemented yet. -
@MrPy thanks for asking. Im still waiting for the ticks_us() function. Currently the precison with ticks_ms() is not enough. I got it working, but only with rough accuracy.
-
@cfaessler said in Timer objects:
@MrPy thanks for asking. Im still waiting for the ticks_us() function. Currently the precison with ticks_ms() is not enough. I got it working, but only with rough accuracy.
Same situation as me then, I'm sure there is a hack to get it working but I might wait until the timer class is supported in the next f/w release.
-
@MrPy Jep, lets hope for the best :) btw, this: https://github.com/mithru/MicroPython-Examples/blob/master/08.Sensors/HC-SR04/ultrasonic.py is a pretty good starting point.
-
@Xykon said in Timer objects:
@cfaessler Timer support should be added soon... hopefully by next Friday as originally announced.
Which friday? Im still waiting for the ticks_us() function. Can everyone show a hack to get the hc-sr04 to get working?
-
@ekpegleg said in Timer objects:
Which friday? Im still waiting for the ticks_us() function. Can everyone show a hack to get the hc-sr04 to get working?
This Friday I believe.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login