View Single Post
  #2   Spotlight this post!  
Unread 03-02-2012, 20:48
BurtGummer BurtGummer is offline
Electrical/Mechanical/Programming
FRC #3020
Team Role: Engineer
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Southern CA
Posts: 89
BurtGummer will become famous soon enoughBurtGummer will become famous soon enough
Re: Integrating Gyro Code

Like you mentioned, just use an analog input on the analog cRIO module. Be sure that the gyro is wired correctly too.

Then in Java, simply create a new gyro object.
Code:
Gyro newGyro = new Gyro(1);   // '1' is what channel the input is attached to on the module.  Change it if necessary.

// The below code is to get the current angle of the gyro.
double gyroAngle;
gyroAngle = newGyro.getAngle();
Does that help?
__________________
I'm a mentor looking for a home in Southern California! I know Java, C++, electrical and mechanical.

Need Java or C++ help? Send me a PM!
Reply With Quote