Maestro 6 script problem

Hi All,

Just received my Maestro 6-Channel controller and I am trying to work out a script to switch 3 servos with 3 independent switches. I am trying to use these three servos to open and close three “butterflies” in a vent tube. This will either allow or deny air flow through the tube.

The setup I am trying to implement is :-
Switch 1 (off=0V / ON=5V) controls servo 1 (off=1ms / on= 2ms - approx. 180 degree swing)
Switch 2 (off=0V / ON=5V) controls servo 2 (off=1ms / on= 2ms - approx. 180 degree swing)
Switch 3 (off=0V / ON=5V) controls servo 3 (off=1ms / on= 2ms - approx. 180 degree swing)

My wiring configuration is :-
Servo 1 is set as a servo on channel 0
Servo 2 is set as a servo on channel 1
Servo 3 is set as a servo on channel 2
Switch 1 is set as an input on channel 3
Switch 2 is set as an input on channel 4
Switch 3 is set as an input on channel 5

I have tried modifying the example code from the user manual (the three switch example) but I’m afraid that my scripting knowledge is very poor and I do not appear to be able to get anything working. I am not bothered about acceleration or speed so I have left these set to zero.

Has anyone done anything like this that can offer some example script code, or even some help

Many thanks…

Ian

do 3 if statements that look at the switchs. If the switch is say closed then make it close the opperiate servo.
after that loop back around to the start.

Im tired and can’t rember the scripts lanaguage off hand but I think your get this

'start loop

loop:
if channel 3 high then
channel 0 180
else
channel 0 0
endif
if channel 4 high then
channel 1 180
else
channel 1 0
endif
if channel 5 high then
channel 3 180
else
channel 3 0
endif
goto loop:

something like that. cool

Many thanks. Will investigate this and report my results.

:smiley: