Making a laser turret for my cats - algorithms for simulating a random fly

I'm making a laser to turret for my cats, using an Arduino Pro Micro, two servos and a laser. I'm having a hard time simulating the flight of an insect, I tried with an implemetation of a Brownian motion algorithm with no luck.

Is there something implemented in C that I can use with the Arduino?

CharlieM:
I tried with an implemetation of a Brownian motion algorithm with no luck.

The cats knew somehow? :slight_smile:

Hahaha, no about Brownian motion! But I noticed that if the movements are too erratic they get bored faster than if there is some kind of pattern.

Check out the Levy flight algorithm, characterized by a long and short trajectories, with random movements akin to those found in turbulence.