Micro maestro 6 code help

I have a quick question and I hope it’s simple enough for anyone to quickly help me. I am trying to program the micro maestro 6. I have the sample code from the manual for analog control of one servo.

# Sets servo 0 to a position based on an analog input.
begin
1 get_position # get the value of the pot, 0-1023
4 times 4000 plus # scale it to 4000-8092, approximately 1-2 ms
0 servo # set servo 0 based to the value
Repeat

I want to do this 3 times but can’t figure out this simple script. I’m not a programmer.

This script reads channel 1 (my pot) and operate the servo on channel 0. At the same time I need to read channels 1,3 and 5 (all pots) and operate servos on channel 0,2 and 4.

Can anyone please show me how to do this quickly and easily? I want to keep this very simple as this is all this unit will do for me.

Thanks

Hello,

If you want to do the same thing for multiple servos, you can just repeat the inside of the loop:

begin
  1 get_position
  4 times 4000 plus
  0 servo

  3 get_position 
  4 times 4000 plus 
  2 servo

  5 get_position
  4 times 4000 plus
  4 servo
repeat

I have not tested that, but it should work.

-Paul

Thanks Paul, it is working just fine. Will the maestro work on both analog and digital servos? I’d rather have the newer digital ones if possible. From what I can tell power consumption is the only drawback. I’m plugged into the wall on this project so I’m not using any batteries at all.

Thanks again for your input,
Shawn

Hello,

Digital and analog servos will both work. Please see our FAQs.

-Paul

I did see this AFTER I posted the question, sorry about that. Thanks again.

Shawn

Hi Paul,

Is it possible to have one channel on the maestro as an input and when it goes high it will tell the servo to reverse it’s direction? Right now I have a 5K slide pot controlling one servo. Push the slide pot right, the servo moves right, push it to the left, the servo moves left. I want to flip a switch that will cause the servo to move left when I slide the pot to the right. And vice versa. Is this simple code to do?

Thanks,
Shawn

Hi Shawn,

If you know how to program, it is probably going to be simple. If you do not, you will need to learn! You could make a attempt and post your code here when you get stuck.

-Paul

Thanks Paul, I just wanted to be sure it’s possible before I make an attempt. I did not want to rack my brain to find out it cant be done.

Shawn