![]() |
Switch with Servo
I was wondering i there was anyway to program a servo to be activated on a rocker switch instead of with a petentiometer, such as have it rotate 180 degrees or something?
|
servo = 127
if sw1 = 1 then servo = 254 if sw2 = 1 then servo = 0 |
you're positive this would work? i've been argueing with our programmer that it is possible.
|
Quote:
Quote:
If you would rather have the servo only go from one extreme to the other, you might want something more like this: Code:
servo = 0 |
YEP...
We used just that to activate a "brake" pin in our gearboxes last year....works fine... |
Quote:
|
we're using a rocker switch. Right now the code we have is this:
p1_wheel = 0 if p3_sw_aux2 = 0 then p1_wheel = 0 if p3_sw_aux2 = 1 then p1_wheel = 63 since the servo is on PWM 9 we're using p1_wheel variable, but yusing the roboemu program, the wheel on the joystick moves the server but not aux2, any help would be appreciated. |
Quote:
If you email me your code, I'd be happy to take a look. RoboEmu doesn't currently have any known issues that would affect code like the stuff you posted, so it's probably a line somewhere farther down overriding your code. Anyways, let me know. rob-bayer@mn.rr.com |
I also found out today that any wheel on a joystick controls p1_wheel, it's strange if you ask me.
|
Quote:
There's just not enough info to go on here. I suggest you do as Rob suggests, and send him your code. Better yet, post it here, and you can have a bunch more pair of eyes looking at it at the same time. |
| All times are GMT -5. The time now is 20:28. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi