Doing an art installation and trying to achieve random servo movement. Is it possible to have long pauses with randomly swiping servo movements in between?
This will have a magnet attached to it that will need to randomly swipe across a piece of looping audio tape - randomly erasing parts of the tape.
Doing an art installation and trying to achieve random servo movement. Is it possible to have long pauses with randomly swiping servo movements in between?
Yes, of course.
But be aware that the Arduino random function is just a pseudo-random number generator and not a true random number generator.
So in case you do not take special provisions, on every start or reset of the microcontroller, the absolutely same sequence of "random" numbers will be generated.
If you want true random numbers instead of pseudo random numbers and the seuence being different each time you power-on or reset the circuit, then you have to provide a random starting value (seed value) for the random number generator. If your device would have interactive sensors, like perhaps a push button, then it would be agood solution to use the "time in microseconds" when a button was pressed, as the seed value of the random number generator.
But in your setup with a looping tape it might possibly not even matter if the sequence of random movements would always be the same after each power-on and each reset.
You can have pseudo-random actions as well as real-random actions. Just as you like.
Hi,
You could have a START and STOP button connected to your controller, and use the time that the button is pressed down to start (using milliseconds) to produce the seed.