Log in

View Full Version : Does anyone know how to ues gyro in Java


Bob Z
04-07-2016, 01:04
Hi guys,
This is the first time our team decide to use gyro and we got this months ago:
http://firstchoicebyandymark.com/fc16-115.
However, we are still struggling finding useful resources for java using that board. Does anyone know how to program that thing? Thanks!

quillford
04-07-2016, 03:10
Analog Devices has all you need in their github repository (https://github.com/juchong/ADIS16448-RoboRIO-Driver). You can see how to use it with this example (https://github.com/juchong/ADIS16448-RoboRIO-Driver/blob/master/Java/example/Robot.java). When you integrate it into your code, you will need this file (https://raw.githubusercontent.com/juchong/ADIS16448-RoboRIO-Driver/master/Java/com/analog/adis16448/frc/ADIS16448_IMU.java).

Jalerre
04-07-2016, 11:13
This (https://wpilib.screenstepslive.com/s/4485/m/13809/l/241871-gyros-measuring-rotation-and-controlling-robot-driving-direction) might be of use to you.

SupremeSteak1
05-07-2016, 09:07
I know that it says this in the resources posted above, but I want to make sure to draw your attention to the fact that the gyro must be plugged into analog ports 0 or 1 or else it will not work. Our team failed to notice it at first and it caused us a lot of trouble.

cpapplefamily
05-07-2016, 10:23
I know that it says this in the resources posted above, but I want to make sure to draw your attention to the fact that the gyro must be plugged into analog ports 0 or 1 or else it will not work. Our team failed to notice it at first and it caused us a lot of trouble.

Our team used the gyro this season and by chance it was plugged into port A0. Are you saying A0, and A1 are the only ports a Gyro will function on even if configured for the other analog port or just for these examples?

Joe Ross
05-07-2016, 12:32
I know that it says this in the resources posted above, but I want to make sure to draw your attention to the fact that the gyro must be plugged into analog ports 0 or 1 or else it will not work. Our team failed to notice it at first and it caused us a lot of trouble.

That applies to an analog gyro. However, the OP is using a digital gyro, the ADIS16448, so it doesn't apply.

Our team used the gyro this season and by chance it was plugged into port A0. Are you saying A0, and A1 are the only ports a Gyro will function on even if configured for the other analog port or just for these examples?

It will only function on A0 and A1.

cpapplefamily
06-07-2016, 01:11
It will only function on A0 and A1.

We missed that in the documentation. We just luck out that we always used A0. Is this true for other devices? We have been trying without success to use a analog Ultrasonic on A5 in the MXP. Could explain a lot.