Skip to content

Conversation

@supcik
Copy link
Contributor

@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)

Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for working on this!

@FoamyGuy FoamyGuy merged commit eb01f1f into adafruit:main Oct 27, 2025
1 check passed
@FoamyGuy FoamyGuy mentioned this pull request Oct 27, 2025
adafruit-adabot pushed a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Oct 28, 2025
@supcik
Copy link
Contributor Author

supcik commented Nov 2, 2025

Thank you.

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.

2 participants