Animated Swing Light

Hi
I would like to have an animated led light under a swing seat.
Has anybody already thought about this or even have a solution.
The light should change with height or speed or angle.
Because of the centrifugal force, I don’t think normal accelerometers would work.

Thanks for any hint

Harald

If gyroscope is an option then there is already a usermod for that

Could you give me a hint where to find this usermod ? Thank you !