attiny tilt switch pwm

Divide by zero is undefined.

I read the link and even googled examples and i dont get it.

Keep working at at!