Examples maestro 1 input rs232 maestro2 output

Hallo Paul,
sorry, I post to the wrong place
But now I think I am right

I am an newbee from Germany and first I want to congratulate you to your maestro parts.
Now my setup wishes:
I have two maestro 18 and I want to use one for input and over the rs232 the other for output to servos etc. with out a Pc connection.
I test this with one maestro and this runs. with out a Pc connection.

exampleskript:

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

Please can you give me examples how to do
Thanks
Klaus Bopp

Hello,

Your question is not very clear. Are you just saying that you want to connect the two controllers to each other with a serial line? What kind of example script do you want to see, and why did you post that example?

-Paul

Hallo Paul,
My exampleskript only shows channel 0 to 5 set as input and 6 to 9 are set as servo controlled by channel 0 to 5.
My Question, is it possible, one Maestro 18 all 18 Channels are set as Inputs and the other Maestro18 all Channels are set as Servo or Output connected over rs232.
If yes then please a short examplesscript maybe only for one or two channels.

thanks
Klaus Bopp

Hello,

The Maestro does not have built-in RS-232. Instead, it has a TTL serial port, which should work just fine. Is there any particular reason you want RS-232 instead?

Now, you can send serial bytes to the UART from a Maestro running a script, like this:

0x84 0x02 0x70 0x2E serial_send_byte serial_send_byte serial_send_byte serial_send_byte

That should send the first example from the Serial servo commands section of the User’s guide, which sets the target to 1500us. Please note that your Maestros will have to be configured to the same baud rate in UART mode for this to work.

If you get that working, try this:

0x84 0x02 serial_send_byte serial_send_byte
0 get_position # get the value of the pot, 0-1023
4 times 4000 plus # scale it to 4000-8092, approximately 1-2 ms
dup
0x7F bitwise_and serial_send_byte # target & 0x7F
7 shift_right 0x7F bitwise_and serial_send_byte # (target >> 7) & 0x7F

I have not tried it, but I translated it directly from the C example in the User’s guide. If you cannot get it to work, try single-stepping through it to see what it is doing wrong.

-Paul

Hallo Paul,

OK it is not a rs232 it is a TTL serial port.
Now I tried the seriel Get Position command in the script
1
16
12
170
serial_send_byte
serial_send_byte
serial_send_byte
serial_send_byte

Where can I get the two-byte response in the script

thanks

Klaus Bopp

Hello,

You cannot read the response from the script. The only thing you can do with the serial port from the script is send bytes.

-Paul