I2C Andymark Gyro Constructor

We are using the Andymark Gyro and Accelerometer combo unit (am-2314) and programming with Java. Currently we have it connected to the I2C port on the RoboRio. What is the constructor for the accelerometer and the gyro? As well as how can I take the feedback and convert it to angles for the gyro and coordinates for the accelerometer?

We have used an ITG-3200 based sensor. This is not the exact AM-2134 model you are describing, but it uses the same chipset for gyro measurements.

It was a non-trivial exercise to get angle information out of this sensor to our robot Java code. We ended up using a background thread that kept reading and accumulating values from the sensor. The ITG-3200 sensor provides deg/sec measurements that you have to integrate (accumulate) over time if you want to get degrees.

We have some Java source code available for the ITG-3200 using an I2C chip out at github that you are welcome to look at, use, modify or experiment with:

https://github.com/frc868/lib-robot/blob/master/src/com/techhounds/lib/util/gyro/ITG3200.java

We have not used the ITG-3200 sensor for the past couple of seasons. We switched a BNO059 sensor from Adafruit that does the accumulation onboard. We have not decided what we will use this year yet. Here is a link to that sensor

WARNING: Neither of these sensors are directly supported in the standard robot libraries.

It takes a considerable amount of time to connect custom I2C circuits to the roboRIO and read through the data sheets and then create the Java code to make use of them. It’s a great and often painful experience for both kids and mentors.

If you do not have a Java and electronics expert on your team, you might be better off in looking for a Gyro that is already supported.

Good luck.

We have used this combo IMU successfully in the past season (2016) with I2C. We want to use it again this season but the same hardware and C++ software do NOT work anymore (2017).

The ITG-3200 portion doesn’t seem to return values - the WPILib (actually the HAL method below it) returns bool 1 - failure - for commands.

The ADXL345_I2C portion returns the apparently correct Y axis acceleration with GetX(), the Z axis with GetY(), and zero (0) with the call to GetZ().

Haven’t made any progress in tracking down the cause. Anybody have any ideas on what changed and what to do about it?

Thanks.