First version, calculations.  PWM next
Demo to see how the whole range of PWM looks on the voltmeter
cleanup using arduino functions