Well, the manual is online..
http://www.melabs.com/resources/pbpm...8-5_53.htm#550
I usally try something that looks good, and then test if it works..
I didnt loop it, ofcoz there is some time it needs to read it, but it can't be very long.
Here is how I used it in my fancontroller:
The pause is mainly for the LCD, dont think it was needed for the pot command.Code:main: pot portb.1,Scale,resist0 ' read value resist0 with scale scale on port d.1 LCDOUT $FE, 1, "Duty = ", #resist0, " ", #pwmfreq, "Hz" HPWM 1,resist0,pwmfreq pause 100 GoTo main
I used a 20K pot and a 220nF cap, with this setup a scale value of 145 was perfect.




Bookmarks