Quote:
|
Originally Posted by Workaphobia
Will that work with any encoder, or only quadrature encoders?
|
The code will probably work with any single input encoder provided that you tell it that the B Channel is an input that is always high or low (disconnected or jumpered). The code will read what it thinks is the B channel and it will see the same value, making it always count in the same direction.
For example, in the interrupt service routine for EasyC you connect the A channel to pins 1-6. When the interrupt on the A channel happens, the code reads the B channel to decide whether to count up or down. It doesn't matter if the B channel is actually connected to an encoder - it only sets the count direction.
If you decide to use EasyC it has built-in encoders that only look at a single input.
Brad