Quote:
Originally Posted by dahlboy15
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?
|
I can see your problem, but I'm not sure how to describe it. My code either told the servo to go to the position it's already at or go to the position it's at +5 degrees. You have two commands, one saying to go to the one it's at and one telling it to go up 5 degrees. This means that several microseconds after it sends the signal to go to one position, it's already telling it to go to another.
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.