![]() |
Servo motor?
So my team and I were trying to figure out how to program a servo motor in teleop where when we push button 1 the servo spins its full range then once the button is released the servo returns to 0° automatically. No clue how to program this and any help given would be great
|
Re: Servo motor?
Quote:
|
Re: Servo motor?
Assuming you don't care about slowing down the servo's motion, what you want to do is pretty easy. Use a joystick button to select between 0 (when false) and 180 (when true), and feed the selected value to a Gyro Set Angle.
I think the default maximum is actually only 170 degrees. You can change it to match the servo you're using when you Open it. |
Re: Servo motor?
3 Attachment(s)
We don't care about speed, and we're just trying to get the servo to go from button not pushed: 0°; button pushed 180°, 170 if this is max.
Below is the code we have so far, it's from an example I believe. Attachment 13831 Attachment 13832 Attachment 13833 |
Re: Servo motor?
The code looks good to me. Another thing to remember is that the servo needs power applied to it, too. There has to be a jumper across the two pins directly next to the PWM port the servo is plugged into.
|
Re: Servo motor?
Quote:
|
Re: Servo motor?
Well.. That opens up a whole 'nother bag of worms. Based on what you have said from your last thread, have you tried swapping the cable from the cRIO to the digital sidecar with a known working one? Remember that last year's ribbon cables shipped assembled backwards, which would screw up a bunch of things.
|
Re: Servo motor?
Quote:
|
Re: Servo motor?
I saw the other thread, and I can't believe I made the fundamental mistake of not suggesting power to the Digital Sidecar. Hopefully applying power will fix everything easily.
|
| All times are GMT -5. The time now is 12:16. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi