Want to make random motion with one button

I am facing a problem. I want to make app which will control the motors attached in my arduino uno and i want motors to run randomly in a pattern but i don’t know how to do that using blynk app.I am actually trying to make random pattern for my motors connected to my arduino.I have connected 5 motors to my arduino and i want to run them randomly for 5 sec(5 second for evey pattern and then next time the pattern wil change) but i dont know how to do that.

The words “random” and “pattern” are somewhat contradictory in your description. A pattern is a pre-defined repeating sequence and random is random.
It may be that you want to have a number of stored pre-defined patterns that you wish to call in a random sequence, or you simply want random motion. If it’s the latter than I can’t see why it would need to change after 5 seconds, as the randomness would take care of that.

Anyway, regardless of what you’re trying to achieve, It sounds like the only role that Blynk will play is as an on/off switch. If that’s the case then the you’re probably best to write your code independently of Blynk, then add-in the Blynk functionality once it works the way you want it to.
Just take care not to put all of your code in the void loop, as this won’t work when you come to add-in the Blynk functionality. Use functions that are called using timers instead.

There are many examples of similar projects using LED strips instead of motors, so maybe search the forum for them to take some inspiration.
However, please don’t hijack one of these LED strip threads by adding a “I want to do a similar th8ng with motors - please help…” comment.


1 Like