How do you measure the duty cycle of sinus with a arduino uno?