View Single Post
  #9   Spotlight this post!  
Unread 31-01-2010, 21:06
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Controlling the camera with a joystick

Quote:
Originally Posted by lscime View Post
We accomplished this by storing the "goal" position in a shift register and incrementing/decrementing/not changing this value depending on a case statement triggered by a joystick.
You can also do without the shift register. Since the FPGA knows what value you've set the servo to, you can use a Get Angle or Get Position vi to retrieve it, apply whatever modifications you wish to the value, and give it to a Set Angle or Set Position vi.

(If you're changing the value by extremely small amounts, you might need to watch out for rounding errors in the conversion between servo position and PWM value.)