Skip to content

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

Merged
merged 1 commit into from
Feb 14, 2017
Merged

Initial commit #1

merged 1 commit into from
Feb 14, 2017

Conversation

deshipu
Copy link
Contributor

@deshipu deshipu commented Feb 4, 2017

No description provided.

Copy link
Member

@tannewt tannewt left a 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.

@@ -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`
====================================================
Copy link
Member

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.

self.init()

def init(self, mode=NDOF_MODE):
chip_id = self._chip_id # WARNING! Side effects!
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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'
Copy link
Member

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
Copy link
Member

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.

Copy link
Contributor Author

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.
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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. :-)

Copy link
Contributor Author

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)
Copy link
Member

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.
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

@tannewt tannewt self-assigned this Feb 5, 2017
@deshipu
Copy link
Contributor Author

deshipu commented Feb 7, 2017

I applied your comments, but didn't test this yet properly, please don't merge.

@deshipu
Copy link
Contributor Author

deshipu commented Feb 11, 2017

I made some more small fixes. Tested this on ESP8266, but couldn't on the Feather M0 because of adafruit/circuitpython#95

Copy link
Member

@tannewt tannewt left a 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.

@deshipu
Copy link
Contributor Author

deshipu commented Feb 12, 2017

I don't have the rights to merge this, so please do it.

@deshipu
Copy link
Contributor Author

deshipu commented Feb 13, 2017

I added some delays to the code make the timeout parameter for i2c not required, and removed the note about it from the documentation.

README.rst Outdated
import adafruit_bno055


All the Adafruit RTC libraries take an instantiated and active I2C object (from
Copy link
Member

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.

@deshipu
Copy link
Contributor Author

deshipu commented Feb 14, 2017

Fixed, sorry.

@tannewt
Copy link
Member

tannewt commented Feb 14, 2017

No problem.

@tannewt tannewt merged commit a705ed3 into adafruit:master Feb 14, 2017
gamblor21 pushed a commit that referenced this pull request Apr 11, 2021
ladyada pushed a commit that referenced this pull request Apr 22, 2021
Hello jposada202020, thanks for the reformatting!
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