View Single Post
  #1   Spotlight this post!  
Unread 03-03-2010, 20:13
lollypop2020 lollypop2020 is offline
Registered User
FRC #2733 (Pigmice)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2003
Location: Portland, OR
Posts: 19
lollypop2020 is an unknown quantity at this point
Using one gyro sensor as two viritual gyros in code

For our code, we need to have the equavalent of two gyros. One of them is used by the driver and by the aiming software and is reset quite frequently. The other one is for the robot's true heading (with error of course), and should not ever be reset. I tried opening two gyro references using the same AI channel, and using each reference respectively where it was needed but I got errors on the DS for trying to use an already allocated AI channel. Is there a way to get around this without keeping track of the angle of the gyro manually? I know I could probably write my own code to have two independant counters that could be used seperately, but I would rather not have to do that, however I will if it's the only option. Could I use a PWM splitter cable and plug one gyro into two AI ports? Or is there anything else I could do?
__________________