View Single Post
  #8   Spotlight this post!  
Unread 31-01-2010, 19:58
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,112
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: Programming Servos.

Quote:
Originally Posted by chsrobotics3283 View Post
Under Begin. vi-
1. I wired a Servo Open. vi to the element thingy from a Servo RefNum Registry Get.vi which takes all the error outs and makes it into one wire to the main wire out
I assume you meant Set, not Get.
Quote:
Under Telop. vi-
1. I wired a Servo RefNum Registry Get .vi to the cage.
The "cage"? I don't understand.
Quote:
Now this is how I am confused, suppose if I wanted the camera to move left with 5 (on joysitck) and move right with 6. How would I configure the buttons on the joystick to do so?
Servos are controlled by commanding them to a position. This differs from motors which are controlled essentially by setting their speed.
What you could do is get the current position of the servo and run that value into a case block controlled by Button 5. In the "true" case, subtract one from the value; in the "false" case run it straight through. Take the output from the case and run it through another similar case controlled by Button 6. Use the output of the second case to set the new position of the servo.

There are other ways to do this, like using a Comparison Select vi, or converting the Button boolean to an integer and either adding or subtracting. It depends on how concise (and how cryptic) you want to make your code.

Quote:
I want the camera to able to track the target with the motors and the servos. By the way I am keeping button 3 which turns the robot.
Tracking the target using both motors and servos is a vague requirement. In order for me to help you, I will need to know more precisely what it is you want to do.
Reply With Quote