-
Notifications
You must be signed in to change notification settings - Fork 53
Update to new build process and turn on lint. #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I haven't tested these changes on device yet. Please only merge you test it or I follow up later to say its tested. For adafruit/circuitpython#475
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The library doesn't work as it is - it returns all 0's for data. It doesn't work before your changes either though without the following alteration to line 179 in this section:
def init(self, mode=NDOF_MODE):
chip_id = self._read_register(_ID_REGISTER)
if chip_id != _CHIP_ID:
raise RuntimeError("bad chip id (%x != %x)" % (chip_id, _CHIP_ID))
self.reset()
self._write_register(_POWER_REGISTER, _POWER_NORMAL)
self._write_register(_PAGE_REGISTER, 0x00)
self._write_register(_TRIGGER_REGISTER, 0x00)
time.sleep(0.01)
self.switch_mode(mode)
time.sleep(0.2)
Changing time.sleep
to 0.2
resolves the issue and the sensor works. Basic testing on my part couldn't sort how to resolve it in the PR code. Adding @deshipu as a reviewer.
self.reset() | ||
self._write_register(_POWER_REGISTER, _POWER_NORMAL) | ||
self._write_register(_PAGE_REGISTER, 0x00) | ||
self._write_register(_TRIGGER_REGISTER, 0x00) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The setting of mode and the delay after it are necessary for this sensor to work. Removing them breaks it.
You need to add this at the end:
self.mode = NDOF_MODE
time.sleep(0.2)
magnetic properties. Orientation should be standardized but its unclear what it should be.
Please re-review. I fixed up the |
Oops, wrong button. :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested successfully! Great job!
Updating https://github.com/adafruit/Adafruit_CircuitPython_BNO055 to 3.0.0 from 2.0: > Merge pull request adafruit/Adafruit_CircuitPython_BNO055#4 from tannewt/lint
I haven't tested these changes on device yet. Please only merge you test it or I follow up later to say its tested.
For adafruit/circuitpython#475