-
Notifications
You must be signed in to change notification settings - Fork 82
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
How to add support for the Pololu AltIMU-10 v4 Gyro, Accelerometer, Compass, and Altimeter? #75
Comments
Just looked up this component. It uses an I2C interface, so what you really need is for dino to be able to communicate via an I2C bus. In a "pure" Arduino sketch, you use the Wire library for that. See here: http://arduino.cc/en/reference/wire If you have one of these parts already, I suggest you play around with it using any "pure" Arduino examples you can find first. This will let you get a feel for it, and the Wire library. Once you understand that, you can follow the same pattern as @supherman did for LCD support. Code is in #32. Explanation is in the first few messages of #34. The basic idea is to leverage the existing Arduino Wire library by including it in the dino sketch, and then talking to it from Ruby. As of the 0.12.0 branch, the Using the LCD as a template: This line in the Arduino code lets the command '10' invoke the LCD library: This function passes execution to At this point, I should clarify the message format. It consists of 4 parts, I'll refer to them by the Arduino variable names:
Wrt handling messages within your library, follow the pattern used for the LCD library here: https://github.com/austinbv/dino/blob/0.12.0-wip/src/lib/DinoLCD.cpp#L21-L43 Context has changed, so the variable Once you get the Arduino side of the code done, you can do a simple Ruby class that uses Give it a try and if you get stuck start a pull request and I'll help. |
Thanks a lot HDR
|
I am new to the arduino platform, but I am interested in using a Pololu AltIMU-10 v3 in a project, are
there any guidelines how to add a component to the Dino gem in order to use the AltIMU-10 from ruby?
Thanks in advance
P.S. any suggestions are welcome
The text was updated successfully, but these errors were encountered: