Selecting a random number between two integers

Hi all…

We’re looking at using Mini Maestro 18-Channel USB Servo Controller for a small project but I have a question about the scripting language.

Essentially we’re looking to run 8+ servo’s off the board but we need a method of selecting a servo at random. The servo then circulates through 90 degrees, stays in that position for a random number of seconds between 5 and 10 and then rotates back to it starting position.

So I believe there’s not problem moving the servo to it’s new position and back programmatically but is it possible in the language to select random number between two integers. For example this is house I’d do it in PHP

rand(5,10)

Appreciate any and all input…

Hi.

There is no random function in the Maestro’s scripting language. You might be able to use the GET_MS and MOD commands together to get a random number in a certain range, though that method would depend on there being variations in the time it takes to run your script. Another way you might be able to get random numbers is reading an unused analog input, but I am not sure how well that would work. This other thread about generating random numbers on the Maestro might also be useful to you.

-Claire

Great, thanks