Pololu Robotics & Electronics
Menu
My account Comments or questions? About Pololu Contact Ordering information Distributors

Pololu Forum

Maestro 6 ch by Switch

Hello from Munich,

I am an absolute layman when it comes to programming and ask for help here.
I have the Maestro 6 channel servo controller and would like to operate 2 servos with one switch.
My goal is to switch between 2 frames with the switch.
So: switch on, the servos should be in position a) and when the switch is off, move to position b) and stay there.
If the switch is then on again, position a).

How can this be achieved? Thank you for your help
Jens
(Text translated by Google Translate)

Hello, Jens.

It sounds like you could probably write a script that does what you described using one IF / ELSE / ENDIF block. For example, you can start your script by checking the switch:

begin
  3 get_position 512 greater_than if    #check if input on channel 3 is reading greater than 512 (the mid point)

Then, if it is in one position, move your servos to position a:

    4000 0 servo   #example of moving servo 0 and servo 1 to some position a
    4000 1 servo

Otherwise, move them to position b:

  else

    8000 0 servo  #example of moving servo 0 and servo 1 to some position b
    8000 1 servo

  endif
repeat

Brandon

Hi Brandon,

Thanks for your help.

But I‘m an absolut beginner. So its all like chinese 4 me;-)

I have bsolut no idea, how to write a script and how to Start. :frowning: