MICRO MAESTRO with switch


I am a french user of a micro maestro and i try to move a servo forward and reward when i push on a button.
My configuration is :
7.4V servo
Resistance 3.3kohm
Switch on channel 5 (value from 0 to 255.75)
Servo on channel 1 (value from 992 to 2000)

Servo is moving and value of input (button NO) is moving from 0 to 255.75 when i push on the button.

I want to move the servo from position A to position B when i touch the button, maintain 5 sec in B and then return to A waiting for next order.

I wrote this script using polulu support :slight_smile:

5 get_position  # get the value of input 5 as a number from 0 to 255
255 less_than   # test whether it is less than 255 -> 1 if true, 0 if false
  2000 1 servo   # this part is run when input5 < 255
  5000 delay
  1000 1 servo   # this part is run when input5 >= 255

The script seems to work…but the servo is not moving !!

Thanks in advance for your help and sorry for my poor english

Hello, Roger.

It looks like you are really close to having it working how you want. The main thing I noticed is that your servo positions are in units of microseconds, but the Script uses units of quarter microseconds. So, if you want the servo to move to 2000µs when the button is pushed and 1000µs otherwise, you should use values of 8000 and 4000 in your code, respectively.

If changing that does not fix your problem, please post a copy of your Maestro settings file, and I would be happy to look into it further. You can save a copy of your settings file from the “File” drop-down menu of the Maestro Control Center while the controller is connected.