Page 1 of 1

Rotary Encoder Text Input

Posted: Sat Jan 30, 2016 5:36 pm
by Steve001
Afternoon All,

Trying to make a text input using a rotary encoder, cannot seam to get it to count correctly seams to only count down, and doesn't seam to count in 1's sometimes jumps 3 - 4 or is this a simulation thing ?


Steve

Re: Rotary Encoder Text Input

Posted: Sat Jan 30, 2016 7:08 pm
by medelec35
Hi Steve I believe for best results you either need to have the encoder check for change s within a port interrupt or you can take a look at this post and see if it helps

Martin

Re: Rotary Encoder Text Input

Posted: Sat Jan 30, 2016 8:21 pm
by Steve001
cheers martin will have a go later

Steve

Re: Rotary Encoder Text Input

Posted: Tue Feb 02, 2016 2:01 pm
by 407charles
Here are some examples of a quadrature encoder programming. There are different strategies for making a counter, that's what you need to do in order to write on a display. You will convert the numbers to characters by using the command print ASCII, from 22 which is the "space" character to 126 which will display the "~" character. You can set upper and lower points for the interval of characters needed. For example, from "0" to small case "z", you will set the intervals from 48 to 122. I tried the programs on a hardware after finish them and they work perfect, if you have a problem check your hardware. I also attached a small program for writing on a display but is set for arduino, you will need to set it for your controller, if you run it in the simulator only press the encoder once at a time, however, it work fine on the hardware. I hope this help. Best regards.

Re: Rotary Encoder Text Input

Posted: Tue Feb 02, 2016 6:30 pm
by Benj
doesn't seam to count in 1's sometimes jumps 3 - 4 or is this a simulation thing ?
Often encoders have a position the knob will settle in but this position is not spaced 1 single increment or decrement apart.

Usually there is 4 signal transitions in between each click position.

00
01
11
10
and then back to 00

So what I sometimes do is divide the count by 4 to get the actual position in terms of meaningful clicks.

Re: Rotary Encoder Text Input

Posted: Fri Feb 05, 2016 8:09 pm
by Steve001
Thanks for the info guys will have a look into it later

Steve

Re: Rotary Encoder Text Input

Posted: Fri Feb 05, 2016 11:01 pm
by medelec35
Hi Steve, Just remembered about this post

Martin