How does this work? Since Enc=Aux=0, How can the If clause be true? There must be some pull-ups in PORTA pins.
Ioannis
How does this work? Since Enc=Aux=0, How can the If clause be true? There must be some pull-ups in PORTA pins.
Ioannis
Last edited by Ioannis; - 18th February 2013 at 10:02.
Here's the initial approach, I've modified for my needs. It does not works, what may be the reason?
MCU is PIC12F683Code:LEFT var GPIO.0 RIGHT var GPIO.1 COUNTER VAR word counter=128 cycl: if LEFT=0 then 'here is switch 1 of the rotary encoder counter=counter+1 goto lcd endif if RIGHT=0 then 'here is switch 2 of the rotary encoder counter=counter-1 goto lcd endif goto cycl lcd: hpwm 1,counter,5000 while (LEFT=0 or RIGHT=0):pause 10:wend goto cycl
well, I think I found the problem - it never treats inputs as inputs, despite a high level on LEFT or RIGHT, it still =0
Seems like I need some command to configure pins as input?
TRISIO=%11111111
does not helps
ANSEL = %00000000
CMCON0 = 7
this helped![]()
Sorry for the late reply
See here and we will resolve the questions
https://sites.google.com/site/proyec...le-con-16f628a
It seems very strange that I got an e-mail notification only today about this thread by dovegroup's reply.
I am not very good at C but from your example, dovegroup, I think the variable x might change more than one at every step in rotating the encoder because of the bouncing effects.
Ioannis
Bookmarks