Quadrature Encoder (mouse)
Posted: Mon Jan 31, 2011 3:03 pm
I am planning on using an encoder from a mouse for a project I am working on. I have Flowcode PIC4 on order.
I know there is not a component for this in Flowcode, (hope they add one). The final project will be on a PIC16F1827, but I am using a PIC16F88 to play with for now.
Does anyone have a "C" sample of how to read the encoder for UP/DOWN Count (left or right)?
I plan on using RA2 and RA3 on the 16F88.
For a start all I want to do is Increment or decrement the count and display it on an LCD. I can handle the display part and the math (Up/Down), but I am totally lost on how to read the encoder. I am still trying to learn C so it does not take much to go right over my head.
Bob
I know there is not a component for this in Flowcode, (hope they add one). The final project will be on a PIC16F1827, but I am using a PIC16F88 to play with for now.
Does anyone have a "C" sample of how to read the encoder for UP/DOWN Count (left or right)?
I plan on using RA2 and RA3 on the 16F88.
For a start all I want to do is Increment or decrement the count and display it on an LCD. I can handle the display part and the math (Up/Down), but I am totally lost on how to read the encoder. I am still trying to learn C so it does not take much to go right over my head.
Bob