View Single Post
  #4   Spotlight this post!  
Unread 05-02-2014, 09:09
Chadfrom308's Avatar
Chadfrom308 Chadfrom308 is offline
Slave to the bot
AKA: Chad Krause
FRC #0308 (The Monsters)
Team Role: Driver
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Novi
Posts: 272
Chadfrom308 is a splendid one to beholdChadfrom308 is a splendid one to beholdChadfrom308 is a splendid one to beholdChadfrom308 is a splendid one to beholdChadfrom308 is a splendid one to beholdChadfrom308 is a splendid one to beholdChadfrom308 is a splendid one to behold
Re: How do you make a trim control?

You would have to take the drive stick value and either scale it to the Z slider value from the joystick, or limit it at the joystick.

If you want to scale it (like if the Z slider was at 70% and the joystick was at 90%, the output would be 63%), take the joystick input and multiply it by the Z input.

If you want to limit it (like if the Z slider was at 70% and the joystick was at 90%, the output would be 70%), take the joystick input and do a greater than block and wire the boolean output to the boolean input on a select function block. After that, route the Z axis into the true input and the joystick axis to the false input

After you have either of those, you have to add a couple of logic statements for going in reverse (Because -z axis * - joystick axis = positive number, driving the robot in the opposite direction)