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
Rotary Encoder Text Input
Moderator: Benj
- Steve001
- Valued Contributor
- Posts: 1189
- Joined: Wed Dec 31, 2008 3:37 pm
- Has thanked: 460 times
- Been thanked: 523 times
- Contact:
Rotary Encoder Text Input
- Attachments
-
- Encoder Test.fcfx
- (9.38 KiB) Downloaded 333 times
Success always occurs in private and failure in full view.
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Rotary Encoder Text Input
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
Martin
Martin
- Steve001
- Valued Contributor
- Posts: 1189
- Joined: Wed Dec 31, 2008 3:37 pm
- Has thanked: 460 times
- Been thanked: 523 times
- Contact:
Re: Rotary Encoder Text Input
cheers martin will have a go later
Steve
Steve
Success always occurs in private and failure in full view.
-
- Posts: 122
- Joined: Thu Jun 26, 2014 12:01 pm
- Has thanked: 41 times
- Been thanked: 19 times
- Contact:
Re: Rotary Encoder Text Input
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.
- Attachments
-
- Writting Data.fcfx
- (14.5 KiB) Downloaded 340 times
-
- Rotary encoder III.fcfx
- (11.83 KiB) Downloaded 360 times
-
- Rotary encoder IV.fcfx
- (14.93 KiB) Downloaded 374 times
- 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 Text Input
Often encoders have a position the knob will settle in but this position is not spaced 1 single increment or decrement apart.doesn't seam to count in 1's sometimes jumps 3 - 4 or is this a simulation thing ?
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.
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
- Steve001
- Valued Contributor
- Posts: 1189
- Joined: Wed Dec 31, 2008 3:37 pm
- Has thanked: 460 times
- Been thanked: 523 times
- Contact:
Re: Rotary Encoder Text Input
Thanks for the info guys will have a look into it later
Steve
Steve
Success always occurs in private and failure in full view.
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact: