Hey CD
Our team has decided to use a gyro, for the very first time
and i was wondering, if your guys can help me out of how to wire and program gyro in Java.
Much Thanks in advance
Hey CD
Our team has decided to use a gyro, for the very first time
and i was wondering, if your guys can help me out of how to wire and program gyro in Java.
Much Thanks in advance
Some explanation and example code in C++ and Java (pages 19-20) here:
http://www.wbrobotics.com/attachments/article/11/WPI%20Robotics%20Library%20User’s%20Guide.pdf
Wiring is covered here:
Okay i understand how to program it, but please could someone expand on how to wire it.
Cuz i did not understand much from the document posted above
The gyro is an analog sensor that measures angular acceleration (how fast the rate of turning is changing with respect to the location of the gyroscope). As such, the gyro is connected to the analog breakout board by 3 wires: power, power return, and signal. The signal line is a voltage between 0V and 5V scaled to the rate of angular acceleration; this is what the “rate” pin in the wiring guide refers to.
In the pinout guide, you’ll also have noticed that there are two sets of pins - rate and temperature. Temperature is included because changes in temperature can affect the output of the sensor that measures angular acceleration, but in FRC its impact is largely negligible. The one you care about is rate, because that’s the one that will let your code determine angular velocity (how fast you’re turning) and angular position (what angle your bot is facing).
So as a summary: The gyro ties into the analog breakout board. The +5V goes to the (+) pin (for power), the GROUND to the (-) pin (for power return) and the RATE to the signal pin, to give you the actual sensor feedback.
If you didn’t get your gyro from the KoP, double check to make sure that it’s analog; if not and it’s digital, you want to tie it to the digital I/O pins on the sidecar.