View Single Post
  #2   Spotlight this post!  
Unread 04-02-2010, 09:02
Ziaholic's Avatar
Ziaholic Ziaholic is offline
Elec/SW Mentor
AKA: Marc
FRC #1164 (Project NEO)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2002
Location: Las Cruces, NM
Posts: 194
Ziaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the rough
Re: NEED HELP WITH SERVOS!!

You need to put some math in between your joystick button outputs, and the Servo Set Angle block.

That SetAngle SubVI is expecting a number between 0 and 180 degrees(typically), and not the simple true/false (boolean) that you're trying to connect in your 3rd image.

How do you want the button(s) to steer it? If you are controlling both the PAN and TILT motors, then you'd need at least 4 buttons to steer it left/right or up/down. Here's one idea, read the angles from the servos, then use some true/false statements from the buttons to either add or subtract some constant value (like 10 degrees) to the read angles, then set that new angle value into the motors. If none of the 4 buttons are pressed, simply pass the original value (Get Angle) to the new value (Set Angle).

There are many many options to do this ... this is just one ... tell us more about your intent ...
__________________
----
There are 10 types of people. Those who understand binary, and those that do not.
Team #1164 - Project NEO Robotics
Reply With Quote