components: Rotary Encoder with push button

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
aspeier
Posts: 8
Joined: Fri Feb 02, 2007 1:50 pm
Contact:

components: Rotary Encoder with push button

Post by aspeier »

Hello,

i need a component like a ** Rotary encoder for Input Device? Will you provide something like this?

Thanks Andy

kostas
Posts: 2
Joined: Sat Feb 03, 2007 12:25 am
Contact:

Post by kostas »

this would be really useful :D

Mark
Posts: 209
Joined: Thu Oct 19, 2006 11:46 am
Location: Bakewell, UK
Has thanked: 20 times
Been thanked: 16 times
Contact:

Post by Mark »

Guys,

I have been interested in using a rotary encoder, however, there does not seem to be a standard device format? nor a commercial device that rotates freely with little force? Hope I am wrong?

I therefore made my own Grey code disc from etched PCB, (which is of course easy to interface) though it is a bit of a toy as it is not robust enough for prolonged use.

Mark
Go with the Flow.

aspeier
Posts: 8
Joined: Fri Feb 02, 2007 1:50 pm
Contact:

Rotary encoder

Post by aspeier »

My question regrading to the support in Flowcode3. I need a device wich i can direct implement in my code. or is there a trick

There are much Rotary encoder knobs on the market and you can reduce input device with a menΓΌ option in your program.

User avatar
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:

Post by Benj »

Hello

When using rotary encoders you have two options.

Sequential Coding - Binary position
Grey Coding - Binary position only 1 bit changes at a time

To implement one of these options requires different code.

Sequential Coding:

Read the binary position and use that to calculate position and direction.

Grey Coding:

Monitor the binary bits and monitor which bits are changing to calculate position and direction.

Then it is simply a case of resolution. Eg a rotary encoder with two bits will give a resolution of 360 / 4 states = 90 degrees.

aspeier
Posts: 8
Joined: Fri Feb 02, 2007 1:50 pm
Contact:

the trick with a men

Post by aspeier »

I want to have a menΓΌ on my 12x2 LCD display and i will do this with a rotary encoder. Yes , it is a 20ppm Grey Code encoder with push button. The problem is not to check the status of the rotary direction or calculate the posission.
I wan't to know how the best programming in flowcode is. Should i use always an interrupt for every changes on Rotary knob and push button or is there a easy way to do this parallel with LCD -Display output.

It would be enought to check it every 1ms-10ms !?

How can /should this Routine can be parallelized with the display ,USB- Routine.

User avatar
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:

Post by Benj »

Can you use a routine like this

Infinite Loop
{
Read Encoder
Calculate position
Read push button
Update LCD
Delay 10ms
}

Gnu
Posts: 20
Joined: Mon Apr 16, 2007 6:59 pm
Location: UK
Contact:

Rotary Encoder

Post by Gnu »

I have been using a 10K continuous mechanical rotation potentiometer (Radiospares Number 460-2048) as a rotary encoder with some success for a long time. If fed 5 volts across the winding, the wiper can be read by a PIC ADC giving a voltage proportional to angle. The drawbacks are that there is a small dead spot of about 5 degrees (which can probably be solved by software), limited life (about 10,000,000cycles), mediocre weatherproofing and a bit of torque needed to move it. Cost in UK about Β£10.

Mark
Posts: 209
Joined: Thu Oct 19, 2006 11:46 am
Location: Bakewell, UK
Has thanked: 20 times
Been thanked: 16 times
Contact:

Post by Mark »

Gnu,

Many thanks, I would never have thought that a continuous rotation pot would be listed as 'one turn', no wonder I did not find it.

Mark
Go with the Flow.

Post Reply