Go Down

Topic: max with a rotary encoder (Read 10 times) previous topic - next topic

Oracle

Quote
i got it working, but did write my "own" little library based on some others.


Nice looking library.  Has anyone used it yet and can confirm it works?

Now for extra credit, I'm already using timer2 elsewhere in my code, and there's no way I can get around using it.  Anyone have suggestions for modifying this library?

The interval I'm using on timer2 changes over a wide range of possible values, so I can't really share the timer.

florinc

What practical application are you using the rotary encoder in? I've got a bunch of them myself, small and good looking, but I cannot figure out a good use for them (actually, I always find a software way to get around using them).

Oracle

This project will generate precision timing pulses (with a frequency set by the rotary encoder), and the precision part is why I have to use the timer interrupt.  It also has to drive a character LCD.

Next project will be almost identical hardware, but it will be in intervalometer for Nikon cameras with the encoder to select time between pictures.

florinc

OK, I see.
Now, I think you would need some feedback for the rotary encoder setting anyway, on an LCD, or some flashing light or something. In this case, can't you have just a push button, and handle the setting through software? (That is, push the button until you reach the desired frequency, and when you reach maximum go back to 0).

Oracle

That is basically what a rotary encoder is except that as you turn the knob it keeps pressing the button for you.

It's a user interface design choice.  There is never an instance where you can't replace a rotary encoder with buttons but there's many cases where the enoder is nicer...volume knob on an amp, jog wheel on a cell phone, etc.  In this case, I have a range of a couple of hundred values, it will be tedious with buttons, but it's just 10 revolutions of the knob for 200 ticks.

In this case, I need coarse and fine adjustments, the encoder has a built in button (push in the knob), so I can have it work as push for coarse leave out for fine.  That's harder to do intuitively with buttons.

I don't know why it makes a difference having an LCD to give feedback.  The encoder doesn't have a "zero" position anyway.  As long as I turn clockwise the number should increase (until the end condition) and counterclockwise should decrease (until the other end condition).  In this case, I'll probably just have the number stay put at the end, not wrap around, or maybe go into a function menu.

Go Up