Code:
loop:
if portb.1=0 then 'here is switch 1 of the rotary encoder
counter=counter+1
goto lcd
endif
if portb.0=0 then 'here is switch 2 of the rotary encoder
counter=counter-1
goto lcd
endif
goto loop
lcd:
lcdout $fe,$c0,dec5 counter
while (portb.0=0 or portb.1=0):pause 10:wend
goto loop
Common of the encoder is Low and Pull Up is supposed to be active.
Ioannis


Menu

Re: I2C LCD 16x2 Pic16f628 Code
There a a few variants of backpack lcd's there are pcf8574 ones and pcf8574a ones. they have different i2c address' ranges.
richard - 4th January 2026, 03:48there are at least two differently wired versions also.
there...