-
Notifications
You must be signed in to change notification settings - Fork 30
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
I2C Tutorial #179
Comments
Hey, @HipsterBrown, I was exploring this issue. So I tried reading from the accelerometer module using the reference code given here and the I2C address for accelerometer module given here. |
@mittalshravika The code for the I2C module is very messy, I apologize :( I think I tried writing a very basic sample before, and wound up with the following. I believe the simplest demo is to write a byte specifying the WHO_AM_I register, 0x0D, then read one byte. So maybe something like this:
The returned buffer from the I2C slave device should be If If all that works, you might have enough to get the example to read acceleration values. Ignore the rest of the setup methods and skip down to the |
Thanks a lot for the inputs!! |
Yes you have! I wrote it incorrectly in my post, but you had it correct in yours. I believe it can also be 0x1C depending on if the two pads on the back of your module are connected. They almost certainly won't be though. |
It looks like you're ready to start a PR for this issue! Good work so far on this. |
Thanks a lot!! We would be sending a PR soon. |
The I2C API methods are currently documented, but it would be nice to add a complete tutorial of how to use the API in a project. (API Reference -> https://tessel.gitbooks.io/t2-docs/content/API/Hardware_API.html#i2c).
The documentation would go in the "Tutorials" directory in a file called
I2C.md
.I think it would be nice to match the structure of the PWM tutorial and Pin Interrupt tutorial. I think the tutorial circuit could use the Tessel accelerometer module because we have working a library to reference.
Steps to complete:
Feel free to mention me in this issue, or a PR, or post in Tessel Slack #community channel with question or if review is needed.
The text was updated successfully, but these errors were encountered: