-
- Downloads
esp8266,esp32: Implement high-res timers using new tick_hz argument.
machine.Timer now takes a new argument in its constructor (or init method): tick_hz which specified the units for the period argument. The period of the timer in seconds is: period/tick_hz. For backwards compatibility tick_hz defaults to 1000. If the user wants to specify the period (numerator) in microseconds then tick_hz can be set to 1000000. The user can also specify a period of an arbitrary number of cycles of an arbitrary frequency using these two arguments. An additional freq argument has been added to allow frequencies to be specified directly in Hertz. This supports floating point values when available.
Loading
Please register or sign in to comment