Animation with button ON and OFF

Hello everyone,
i would like some advice to create a function regarding the animation of a wind blade, when the button is on the wind blade rotates, while if the button is off the wind blade stops