View Single Post
  #2   Spotlight this post!  
Unread 16-01-2016, 20:30
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 542
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: How to use a gyro?

The "FPGA" refers to the hardware on the roboRIO thats running the linux archetecture that we deploy code upon. When it says "The FPGA", I assume its referring to the integration of the gyro... The gyro is a rate sensor, not a position sensor, so the integration is done on the FPGA (circuit-side) to get cycle times of >60hz (oh yes I am correct on this assumption as i actually read your post)

That tutorial on ScreenSteps should work fine, just follow it as it says.

Also, you don't need to connect both ports if you're looking to do something like turning 45 deg. On the KoP gyro, the port you want is closest to the edge and signal is facing inward

After that, just initialize it as it says in the screensteps

Code:
 myGyro = new AnalogGyro(port)
and to get the delta angle (angle since last reset),

Code:
myGyro.getAngle()
If you want to reset it, just call

Code:
myGyro.reset()
and getAngle() will return 0. If you turn 15 deg, getAngle will return 15deg. If you turn 30, it will return 30deg. etc.
__________________
FRC Team 1684 - Head Programmer (2013-2016)
FRC Team 5460 - Programming Mentor (2015-2016)

FIRST in Michigan - Technical Crew (2015-continuing)
Reply With Quote