Hi Brandon,
Here is what I have come up with to date. Before I tried a serial connection between two boards I wanted to run a test on one board to make sure the general idea would run as planed. I came up with the following script using the few examples I could find in the users guide. It uses “get_position” commands to get the position of 6 pots, scale the value and place it on the stack. It then uses a subrutine “apples” to set each servo in descending order. Each servo command taking a value off the top of the stack until none are left at which point a return command starts the process over again. Here is the script:
[code]begin
0 get_position #get position of pot #0, place on stack
4 times 4000 plus #scale it to 4000-8092, approximately 1-2 ms
1 get_position #get position of pot #1, place on stack
4 times 4000 plus #scale
2 get_position #get position of pot #2, place on stack
4 times 4000 plus #scale
3 get_position #get position of pot #3, place on stack
4 times 4000 plus #scale
4 get_position #get position of pot #4, place on stack
4 times 4000 plus #scale
5 get_position #get position of pot #5, place on stack
4 times 4000 plus #scale
apples #goto subrutine apples
repeat
sub apples
11 servo #set servo #11 taking number from top of stack
10 servo #set servo #10
9 servo #set servo #9
8 servo #set servo #8
7 servo #set servo #7
6 servo #set servo #6
return #go to the beginning and start over again[/code]
The script runs very smooth. I can turn multiple pots at the same time with no lag or errors. The servos also run very smooth. I don’t see any problem expanding its range to 12 pots and 12 switches controlling 24 servos on a second board.
My next step was to to connect two boards together through their serial UART.
TX on one board to RX on the next. Then RX on the first Board to TX on the second. OK, here is what I came up with. Remember I’m a product designer not a programmer so bear with me. As in the first script the “get_position” command, “times” command and “plus” command gets the pot position scales it and places it on the stack for all 6 pots. Subroutine “mini_ssc” then jumps to my list of servos that are on the second board. As it goes down the list of values another subroutine “send” uses the serial servo command “0xFF” to set target which uses the servo number in the list along with the pot position from the stack. This repeats for each “send” command until there are none left at which point a “return” command starts the process over again from the top. At least that is what I want to happen. It doesn’t quite work. I can step through the script and it flows through each line and appears to function. The servos even move a bit but when I “Run Script” all the servos on the second board just flutter. Here is the script:
[code]100 delay
begin
0 get_position #get position of pot #0 and place on stack
4 times 4000 plus #scale it to 400-8092, approximately 1-2 ms
1 get_position #get position of next pot #1, place on stack
4 times 4000 plus #scale
2 get_position #get position of next pot #2, place on stack
4 times 4000 plus #scale
3 get_position #get position of next pot #3, place on stack
4 times 4000 plus #scale
4 get_position #get position of next pot #4, place on stack
4 times 4000 plus #scale
5 get_position #get position of next pot #5, place on stack
4 times 4000 plus #scale
mini_ssc #goto subroutine mini_ssc
repeat
sub mini_ssc #Subroutine, take servo positions of the top of the stack
5 send #send servo position #5 to through serial UART to Maestro board 2 using ssc command
4 send #send servo position #4
3 send #send servo position #3
2 send #send servo position #2
1 send #send servo position #1
0 send #send servo position #0
return
sub send
0xFF serial_send_byte serial_send_byte serial_send_byte #serial servo command to set target
return[/code]
What am I doing wrong? I feel I’m close. Is it the wrong serial servo command? Am I scaling when i don’t need to?
Please give me an example and don’t send me back to the user guide. The guide is written by programmers for programmers. When you refer a person like me to the users guide its like tying my hands behind my back and dropping me in the ocean. If I’m near the beach I might land on my feet and keep my head above water. Your the lifeguard standing on the shore line with a life preserver/example in one hand. When you send me to the users guide it’s like asking me to go deeper. If the water gets above my head I wont return. If you throw me the life preserver/example I can put it on and make my way to shore. Your guide should be full of examples. It’s what makes Arduino’s so popular, examples everywhere. Give me examples and I can slowly put the pieces together to get to where I need to. After all the ultimate goal of this forum is to teach people how to use Maestro boards so you sell more product. That’s what pays the bills. If I reach my goal I will buy much more of your product to put in mine. Please don’t make it too hard for me the only programming I have had was a little Basic back in the early 80’s. I had to know it to use my first computer which was a TRS80 from Radio Shack. Back when it was an electronic store and not the junk store it is now. But then your probably not old enough to remember that.
Your all doing a great job but stop apologizing and help people by writing more examples.
Thanks,
Leonard