Hello,
I can't really see any problem with it.... What does doesn't work mean in this case, what does it do?
The only think I can think of is if you have anything else connected to PortA so that the actual value assigned to EncoderState1 isn't 0 even when the encoder is in the zero-position. But since it works with the IF-THEN version it can't be that (?).
Do you have a serial connection setup? If so you can HSEROUT some debug information which will make it easier to figure out what's going on. If not perhaps you could blink a LED the same number of times as the value that gets assigned to EncoderState1, just to see what's going on.
/Henrik.
Bookmarks