Closed jrddunbr closed 1 year ago
If you have time, could you add a unit test?
Do you have examples of unit tests in this codebase that set a good example of what you want to see? I was considering an integration test by making all of the examples in the manual for the device, but decided against it for this PR. Ended up doing a few of them.
Do you have examples of unit tests in this codebase that set a good example of what you want to see? I was considering an integration test by making all of the examples in the manual for the device, but decided against it for this PR.
Yes, look at tests/test_sensors.py
, there is a test for all sensors.
You can run them with python3 -m pytest
This is still on my radar, I just haven't had the time this month to work this.
Rebased PR on current tip. Might work on this today.
So something must be broken with my implementation for the analog write functionality because it is getting the first command right (might be a fluke) and then subsequent ones cause the frequency to go into the kHz when I'm sending values under 500Hz.
Bytes were swapped. Fixed.
Items left on this:
I accidentally refactored a bunch of the HiTechnic file thinking that Sphinx was not loading it properly and causing build failures, turns out it was an unrelated issue. It cleans up the comments and fixes most of the syntax errors except where it would likely break existing API functionality (this could be broken in the future if desired to make it PEP-compliant, but I didn't see a need to break it now).
This seems to work with all supported python versions: https://builds.sr.ht/~ni/job/832337
This commit adds support for the HiTechnic SuperPro breadboardable breakout. It's no longer sold and the documentation is hard to find, but I have one of them and tested most of the functionality.
The only functionality that doesn't make sense to me is the "Strobe" functionality; it appears to be simply digital outputs, but there is not much documentation about what it does. Nothing interesting shows up on the o-scope while using this part of the device.
Also includes a demo of a bar graph doing a binary count from 0 to