|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: servo
I hooked up your simplified version to the buttons. I've attached the vi below. It still does nothing. No servo moves at all when I press a button. I replaced a couple (+) vis with (-). I want to control up with 3, down with 2, left with 4, and right with 5. What's wrong with the program?
|
|
#2
|
|||||
|
|||||
|
Re: servo
Perhaps nothing is wrong with the program.
Did you remember to install the 6v servo power jumper next to the PWM output pins on the Digital Sidecar? Without that jumper in place, the servo won't be powered and won't be able to move at all. |
|
#3
|
||||
|
||||
|
Re: servo
Quote:
I could give you a few ways to make it either go +0, +5, or -5, but it looks like you really want to be able to hold down the button and have the camera move down. In that case, you can just have a selector or case structure with the input wired to the joystick button; the true case wired to "add five" and the false case have another identical case structure but with a "subtract five" in the true case and a "say the same" in the false case. Remember to use a feedback node to have the servo remember its current position. Sorry I can't give you another example, but I really have to do my homework and get to bed. |
|
#4
|
|||||
|
|||||
|
Re: servo
I think this thread is getting more complicated then it needs to. The way I understand your question is that when a button is not pressed you want a servo to be at angle X, and when it is you want it to be at angle X+5. Is this right?
The way I would do this is by having a true/false case statement with the numeric constant X in the false case and X+5 in the true case. I would then feed this value in to the WPI servo .vi called "Set Angle". This code would make the servo go to one angle (in this case X) while the button is not pressed and another (in this case X+5) when it is. If you still don't see any movement try changing the values from X and X+5 to 0 and 170, it could just be to small a change to see. If there is still no servo movement after that, respectfully suggest to electrical it's their fault, calmly double check your code, then yell at electrical. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|