I thought that the new PWM.bas would sort that side out?
I'm not sure how to read Setfrequency() and maxduty()
Could you give me an example of what I have to do for a 1khz frequency and 10bit input duty.
Thanks
pwm.SetFrequency(1000)
// make sure adc reading is < pwm maxduty value
adc_val = adc.read(A2)
if (adc_val > pwm.MaxDuty()) then
adc_val = pwm.MaxDuty()
endif
pwm.write(whatever, adc_val)
Users browsing this forum: No registered users and 1 guest