View Single Post
  #1   Spotlight this post!  
Unread 25-01-2012, 20:54
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Setting motor output based on gyro angle

Hello -

Here's the logic behind what I want to do. Note that all of this code is within a while loop inside Periodic Tasks.vi. I want to use the rangefinder and gyro to help one of the drivers shoot.

I want to get the distance from the rangefinder, and if it falls between a certain range, make a case structure true. Within this structure, I can then press button 1 on a joystick to make the next case structure true. Within this next case structure, I'm getting the Gyro angle and seeing if it falls within a range of angles. If it's false, I want to set the motor output of a motor to 0.25 until the angle falls within a range of angles. Download the VI to see what I've drafted.

Do you think this will do what I want it to do?

Thanks.

Last edited by DominickC : 25-01-2012 at 21:12.
Reply With Quote