Am I missing something? Probably I do
I've made a simple Flowchart with a GLCD and a rotary encoder.
The encoder triggers an interrupt and if the "check for change" macro doesn't return 255 the counter is read.
But each click gives me an increace or decrease of 4...
I've tried several changes for the encoder (fast/medium/slow) but this error is persistent.
What am I doing wrong?
Thanks
Rotary encoder: 4 counts per click?
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Rotary encoder: 4 counts per click?
Hello,
I've experienced this.
For each click of the encoder it travels through 4 states hence the output count of 4. Not sure why but it's normal.
Simply divide the number by 4 (or right shift the value by 2 for efficiency) to collect the click count.
I've experienced this.
For each click of the encoder it travels through 4 states hence the output count of 4. Not sure why but it's normal.
Simply divide the number by 4 (or right shift the value by 2 for efficiency) to collect the click count.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 67
- Joined: Tue Sep 16, 2008 2:09 pm
- Location: Minnesota USA
- Has thanked: 4 times
- Been thanked: 17 times
- Contact:
Re: Rotary encoder: 4 counts per click?
The reason it is called a "quad" encoder, is because it counts the state change of each edge. Since there are 4 edges per cycle, that would equate to 4 counts per "count".
Your encoder is probably mechanically indented creating the sine and cosine signal. For a no indented encoder (such as on a motor) it would be possible to count a single edge.
The advantage of this is that the encoder resolution for a 200 count/rev encoder would be 800 counts per revolution. Creating better resolution
Hope this throws some light on the subject.
Your encoder is probably mechanically indented creating the sine and cosine signal. For a no indented encoder (such as on a motor) it would be possible to count a single edge.
The advantage of this is that the encoder resolution for a 200 count/rev encoder would be 800 counts per revolution. Creating better resolution
Hope this throws some light on the subject.