View Single Post
  #11   Spotlight this post!  
Unread 01-29-2016, 03:34 PM
mmaunu's Avatar
mmaunu mmaunu is offline
Registered User
FRC #2485 (W.A.R. Lords)
Team Role: Mentor
 
Join Date: Mar 2013
Rookie Year: 2010
Location: San Diego, CA
Posts: 86
mmaunu is a jewel in the roughmmaunu is a jewel in the roughmmaunu is a jewel in the roughmmaunu is a jewel in the rough
Re: Noob question for teleop

Quote:
Originally Posted by CjDace View Post
This is the gyro we are using as of now.
http://firstchoicebyandymark.com/fc16-000
For that gyro, you are connected to the correct port (the onboard SPI port). To construct a gyro object in code, you will want to use the Java class that was built specifically for this gyro:
http://first.wpi.edu/FRC/roborio/rel...S450_Gyro.html

You should be able to use the default (no parameter) constructor.
gyro = new ADXRS450_Gyro();

Now, in your drive code's call to the mecanum_Cartesian() method, you should be able to use gyro.getAngle().

Keep asking if it ain't working.
__________________
2014 Las Vegas (Winners with 987, 2478; Excellence in Engineering)
2014 San Diego (Finalists with 987, 3250; Quality Award)
2013 Inland Empire (Winners with 1538, 968; Excellence in Engineering Award)
2013 San Diego (Finalists with 2984, 4322; Creativity Award)
2012 Las Vegas (Finalists with 2034, 3187; Quality Award)
Reply With Quote