Skip to content

Conversation

supcik
Copy link

@supcik supcik commented Oct 5, 2025

This pull request addresses the issue #7.

I made a separated function read_fast for the bit banging reading of the AD. This improved the performance by caching the object reference and opens up possibilities for other implementations.

The delays are enforced with the microcontroller.delay_us function.

I had to disable the interrupts during the read, because according to the datasheet, the clock is not allowed to stay up for more than 50µs during the operation :

image

With interrupts on, I was not able to guarantee the correct timing.

I tested on a ESP32 and it never failed.

Note that some other lines have been reformated according to the style guide defined in ruff.toml (line-length = 100)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant