-
Notifications
You must be signed in to change notification settings - Fork 53
Initial commit #1
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
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.
Thanks for letting me review this. Overall its looking pretty good. The register stuff makes it really simple.
adafruit_bno055.py
Outdated
@@ -19,11 +19,150 @@ | |||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |||
# THE SOFTWARE. | |||
""" | |||
`adafruit_bno055` | |||
==================================================== |
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.
Please add a top level description. Its the top most part of the documentation.
adafruit_bno055.py
Outdated
self.init() | ||
|
||
def init(self, mode=NDOF_MODE): | ||
chip_id = self._chip_id # WARNING! Side effects! |
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.
No side effects comments please. Properties make it clear that state is being read or changed.
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.
I need those comments to keep track of what is happening. Otherwise I would have written here:
if self.chip_id != _CHIP_ID:
raise RuntimeError("bad chip id (%x != %x)" % (self.chip_id, _CHIP_ID))
and the users would be left wondering at an error like "bad chip id (0xa0 != 0xa0) if the communication worked fine the second time around.
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.
These property reads don't actually have side effects. They just read state that may change. You are also welcome to change the internal properties into manual i2c read and writes if you think that will make it clearer. The register library is best used for directly exposed registers.
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.
OK, I will do that, it should read better then.
conf.py
Outdated
copyright = u'2017 Radomir Dopieralski' | ||
author = u'Scott Shawcroft' | ||
copyright = u'2017, Radomir Dopieralski and Adafruit Industries' | ||
author = u'Radomir Dopieralski' |
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.
I think this is the only change you actually need from this file. The rest are comments and the intersphinx mapping actually gets reduced.
README.rst
Outdated
Dependencies | ||
============= | ||
This driver depends on: | ||
import bno055 |
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.
I believe this should be import adafruit_bno055
.
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.
Oops, you are right, missed it.
README.rst
Outdated
|
||
Note that because we can't control the clock stretching timeout in | ||
CircuitPython, you have to set the I2C clock speed to a fairly low value for | ||
reliable communication. |
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.
Please add a note about the corresponding issue so that people can see if its been resolved.
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.
I'm not sure what you mean. I added a note about the problem -- this is that note. Can you give an example of what exactly I should add?
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.
I mean a link to the issue. You did add a note. :-)
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.
Aah, ok, will do.
README.rst
Outdated
============ | ||
print(sensor.temperature) | ||
print(sensor.euler) | ||
print(sensor.gravity) |
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.
Cool! That looks really simple.
README.rst
Outdated
|
||
Contributions are welcome! Please read our `Code of Conduct | ||
<https://github.com/adafruit/Adafruit_CircuitPython_bno055/blob/master/CODE_OF_CONDUCT.md>`_ | ||
before contributing to help this project stay welcoming. |
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.
Please do a manual merge on this file. The existing README you have is really good but it clobbers some other important stuff.
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.
Will do. This all was written last weekend, before you created the repositories, and this weekend I was travelling, so I couldn't merge it all properly -- but I still wanted you to see the code.
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.
K no worries. As a heads up, I'm traveling to Europe on Wednesday and will be online sporadically for the next week or so after that.
I applied your comments, but didn't test this yet properly, please don't merge. |
I made some more small fixes. Tested this on ESP8266, but couldn't on the Feather M0 because of adafruit/circuitpython#95 |
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.
Code looks good. Feel free to merge when you've feel its ready or ping me if GitHub doesn't allow you to do it.
I don't have the rights to merge this, so please do it. |
I added some delays to the code make the |
README.rst
Outdated
import adafruit_bno055 | ||
|
||
|
||
All the Adafruit RTC libraries take an instantiated and active I2C object (from |
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.
This needs to be updated here too.
Fixed, sorry. |
No problem. |
Hello jposada202020, thanks for the reformatting!
No description provided.