The big lesson learned was “correct addresses are key”. The code in WPILIB for the ADXL345 had a hard-coded address that was not correct for this combo board. The only change I made to this file was the address. The gyro took some more care as it uses partial bytes for control data. My hack of a method for setting up the masks is nothing to be excited about, but it works.
Were you able to get the gyro to work and return an angle?
From what I understand from your code, its seems like you are just getting the rate of rotation. According to the datasheet, the GYRO_OUT_ registers contain the rate of rotation. The gyro rate needs to be converted to degrees per second and then integrated to get the angle.
We are still pretty early in our progress with this. What we do have is raw values from the registers for all three gyro orientations and all three acceleration vectors from this combo board showing up on our Smart Dashboard. When I change the orientation of the device I see a ‘~reasonable’ change in the data. We still need to perform some test runs, gather data, and make sense of what we have.
I really appreciate your link. There are several concepts in your code that we will review and likely adopt. On one hand I wish I had your source three days ago. On the other hand it was a fun tour through an engineering problem with our students.
How are you all going? I wanted to thank you so much for your Java implementation for this combo board. I’m attempting to use it now with a beaglebone black in addition to my real-time java code.
I’m just having trouble hooking everything up correctly - the edu.wpi libraries you use, are they specific to the boards you were communicating with? I’m assuming I’d have to replace those libraries with my BeagleBone Black board I2C libraries, yeah?
I’ll continue trying, and if I come up with a solution I’ll also add my code into a public repo and post it here for everyone.
I just hate the eclipse environment. Trying to add board dependencies and importing them to existing code can be such a pain in the neck with the IDE.