Add delay argument to analog_write #141
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm using a ATTiny817 Seesaw in an application where I need the main code to execute as fast as possible. When sending PWM commands to the Seesaw, the current analog_write method has a blocking
time.sleep(0.001)
that would introduce an unwanted delay in the loop. I propose to add an argument that would allow the user to modify this as necessary for their code.This has been tested with a ESP32-S3-DevKitC-1-N8R8 successfully using a delay of 0 and only calling analog_write at random intervals ranging from 50 to 100 milliseconds.
I feel this is consistent with #90 that similarly allowed for users to decrease the delay on analog_read commands. The default behavior of this change still implements a one millisecond delay, so it should have no effect on existing code that uses this library.