Nodemcu lua simple delay3/30/2023 ![]() callback an optional callback function or number, if present the function returns immediately and goes asynchronous.cycle_num an optional number of times to run through the sequence.delay_times an array of delay times in µs between each toggle of the gpio pin.start_level level to start on, either gpio.HIGH or gpio.LOW.rout(pin, start_level, delay_times ]) Parameters ¶ ![]() In short it means that the sum of all delay times multiplied by the number of cycles should not exceed 15 ms. Failure to do so may lead to WiFi issues or outright to crashes/reboots. Note that the synchronous variant (no or nil callback parameter) function blocks the stack and as such any use of it must adhere to the SDK guidelines (also explained here). An error will be raised if the timer is already in use. As there is only a single hardware timer, thereĪre restrictions on which modules can be used at the same time. HW timer FRC1_SOURCE mode is used to change the states. In this mode the function does not block the stack and returns immediately before the output sequence is finalized. If the parameter is numeric the function still goes asynchronous but no callback is invoked when done.įor the asynchronous version, the minimum delay time should not be shorter than 50 μs and maximum delay time is 0x7fffff μs (~8.3 seconds). If present and is of function type the function goes asynchronous and the callback function is invoked when sequence finishes. Whether the asynchronous mode is chosen is defined by presence of the callback parameter. * asynchrounous - synchronous operation with less granularity but virtually unrestricted duration. * synchronous - for sub-50 µs resolution, restricted to max. After the last cycle and last delay the pin is not toggled. Serialize output based on a sequence of delay-times in µs.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |