Hi
I'm trying to use the pot command in order to read 8 switches
I have put 8 different resistors in serie with a pushbutton
and as described in the pbp manual 100nf to ground
Then to test I took a 47K pot with 100nf and the following code
but regardless off the value (128) i can see the var changing to 128 max and then it goes back to 0 even if I still continue increasing or decreasing the resistance value
tried 220nf and 10nf the change the time constant with no result
anyone who can reach a full 0-255 range with 47K pot and 100NF ?
define OSC 20
'PORTD
' Define LCD registers and bits
Define LCD_DREG PORTD
Define LCD_DBIT 4
Define LCD_RSREG PORTD
Define LCD_RSBIT 2
Define LCD_EREG PORTD
Define LCD_EBIT 3
b0 var byte
loop:
pot portc.7,128,b0
pause 50
Lcdout $fe, 1 ' Clear screen
Lcdout #b0
goto loop
Bookmarks