You almost had it right Fratello.
And the timing will be more accurate if you don't do the math on each loop.
Code:vmax = 0 for cnt=1 to 70 adcin 3, v_cal vmax=vmax max v_cal pause 100 next cnt v_cal=vmax * 5000 ' I use VDD as Vref v_cal=div32 1023
Bookmarks