Left Coast, CA (USA)
Online
Brattain Member
Karma: 279
Posts: 15327
Measurement changes behavior
|
 |
« Reply #15 on: January 31, 2013, 04:11:07 pm » |
It doesn't work. I agree in your mind it doesn't work. In my mind I can make it work perfectly. You seem to thinking turning among the options offered is the same as selecting an option, there is always another user action required to select the displayed option. Lets leave it at that. Lefty
|
|
|
|
|
Logged
|
|
|
|
|
Anaheim CA.
Offline
Edison Member
Karma: 31
Posts: 2311
Experienced old Whitebeard with a Full head of Hair...
|
 |
« Reply #16 on: February 01, 2013, 10:31:54 am » |
It works perfectly... providing that you choose to save the previous state so re entry places you at the position you exited at. Positional feedback must be from the visual display and not the knob. You don't read the knob you use the knob to read... Regardless of what the knob really is, rotary encoder, pot or rotary switch. Using a rotary encoder is probably the best move as it doesn't have the 270 deg rotational limitation of a pot or the mechanical stops that most rotary switches do. {Edit RKJ}
Bob
|
|
|
|
« Last Edit: February 01, 2013, 10:35:41 am by Docedison »
|
Logged
|
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 36
|
 |
« Reply #17 on: February 01, 2013, 11:27:32 am » |
Thanks for the suggestions and ideas. For me I guess a normal pot would be ok since I only need to. Switch between 2-3 pages.
Now the next question. Can I use a digital (pwm) pin for this? This can be made to know what position the pot is right or do I need an analog pin?
What type of pin should I use for a rotary encoder?
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Online
Brattain Member
Karma: 279
Posts: 15327
Measurement changes behavior
|
 |
« Reply #18 on: February 01, 2013, 11:33:39 am » |
Thanks for the suggestions and ideas. For me I guess a normal pot would be ok since I only need to. Switch between 2-3 pages.
Now the next question. Can I use a digital (pwm) pin for this? This can be made to know what position the pot is right or do I need an analog pin?
What type of pin should I use for a rotary encoder?
A digital pin used in PWM service is an output pin, it could not be used to 'read' anything. Reading something is an inputting function for your arduino board. An analog pin must be used to read a pot because a pot is only capable of generating a variable DC output voltage to be wired to a analog input pin. A rotary encoder needs to use two digital input pins and depending if you want to use interrupts to service the encoder or not you may be limited to using digital pins 2 and/or 3. Lefty
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 36
|
 |
« Reply #19 on: February 01, 2013, 11:45:22 am » |
Ah, of course, thanks! I think I might need to buy a Mega since I'm running out of pins. 
|
|
|
|
|
Logged
|
|
|
|
|
South Texas
Offline
God Member
Karma: 8
Posts: 976
|
 |
« Reply #20 on: February 01, 2013, 12:03:42 pm » |
A rotary switch with resistors in series. As you turn the switch to the various poles the resistance changes and you use that resistance value to determine which page to turn to. Basically what you wold be making in a multi-tap voltage divider.
|
|
|
|
|
Logged
|
|
|
|
|
Valencia, Spain
Offline
Edison Member
Karma: 65
Posts: 2281
|
 |
« Reply #21 on: February 01, 2013, 01:42:11 pm » |
A rotary switch with resistors in series. As you turn the switch to the various poles the resistance changes and you use that resistance value to determine which page to turn to. Basically what you wold be making in a multi-tap voltage divider.
Why not use a rotary encoder? It's what they're for.
|
|
|
|
|
Logged
|
|
|
|
|
Valencia, Spain
Offline
Edison Member
Karma: 65
Posts: 2281
|
 |
« Reply #22 on: February 01, 2013, 01:44:53 pm » |
It works perfectly... providing that you choose to save the previous state so re entry places you at the position you exited at.
That's precisely what makes the pot fail. There's situations where you can't turn it any further left or right. A rotary encoder turns forever. Rotary encoders usually have a push switch in the knob, too. You can use it as "select" without taking your hand off it to press a separate button.
|
|
|
|
« Last Edit: February 01, 2013, 01:46:32 pm by fungus »
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Online
Brattain Member
Karma: 279
Posts: 15327
Measurement changes behavior
|
 |
« Reply #23 on: February 01, 2013, 02:39:46 pm » |
It works perfectly... providing that you choose to save the previous state so re entry places you at the position you exited at.
That's precisely what makes the pot fail. There's situations where you can't turn it any further left or right. A rotary encoder turns forever. Why must it be able to turn more left or right, as long as it can be turned to all the defined selections?Rotary encoders usually have a push switch in the knob, too. You can use it as "select" without taking your hand off it to press a separate button. So do some pots have a push switch built in. Also an encoder might have 200 steps per rev, your sketch has to jump through some hoops to limit the menu choices to just the number defined say a dozen or less? Opps I said I was done with this topic didn't I? 
Lefty
|
|
|
|
|
Logged
|
|
|
|
|
Valencia, Spain
Offline
Edison Member
Karma: 65
Posts: 2281
|
 |
« Reply #24 on: February 01, 2013, 03:51:10 pm » |
That's precisely what makes the pot fail. There's situations where you can't turn it any further left or right. A rotary encoder turns forever.
Why must it be able to turn more left or right, as long as it can be turned to all the defined selections?
Because the value displayed won't always match the position of the pot. The display/pot get out of sync when you go to submenus. You end up in situations where you might want to turn the pot left but it's already fully left so you can't.
|
|
|
|
|
Logged
|
|
|
|
|
Anaheim CA.
Offline
Edison Member
Karma: 31
Posts: 2311
Experienced old Whitebeard with a Full head of Hair...
|
 |
« Reply #25 on: February 01, 2013, 04:30:10 pm » |
I Think Young Person that you need to do some reading so that you have a better idea of what you have, what you want to do and how you are going to do it. Before you start to work, You must "Plan your Work" and then you Must "Work Your Plan".
Bob
|
|
|
|
|
Logged
|
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
|
|
|
|
Offline
Edison Member
Karma: 114
Posts: 2205
|
 |
« Reply #26 on: February 01, 2013, 05:56:28 pm » |
For me I guess a normal pot would be ok since I only need to. Just so you know, there are digital pots that can be incremented / decremented via up/down buttons, making them far more usable here.
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Online
Brattain Member
Karma: 279
Posts: 15327
Measurement changes behavior
|
 |
« Reply #27 on: February 01, 2013, 06:03:40 pm » |
That's precisely what makes the pot fail. There's situations where you can't turn it any further left or right. A rotary encoder turns forever.
Why must it be able to turn more left or right, as long as it can be turned to all the defined selections?
Because the value displayed won't always match the position of the pot. The display/pot get out of sync when you go to submenus. You end up in situations where you might want to turn the pot left but it's already fully left so you can't. You still create problems that exist only in your mind. 
If your sketch wants/needs to jump to a new sub menu, then the first choice it should display is that which corresponds to where the pot actually is at that specific time, simple. And again that doesn't select the displayed option as that takes an additonal user's action such as pushing the push button.
Lefty
|
|
|
|
« Last Edit: February 01, 2013, 06:06:30 pm by retrolefty »
|
Logged
|
|
|
|
|
Australia
Offline
Sr. Member
Karma: 7
Posts: 317
Arduino rocks
|
 |
« Reply #28 on: February 01, 2013, 06:41:17 pm » |
These rotary encoders also embody a select switch by pressing down on the knob. (appologies for being a Sparkfun tart yet again). https://www.sparkfun.com/products/9117However, having programmed a few of these menu systems using various rotary encoders (use a four line LCD for clarity of the scrolling menus in the users mind rather than the two line) I find that these type of units have fairly fine dentents (or 'dents'). It can make it easy to overshoot. One of those clunky rotary switches (with resistors soldered between the tabs) will have a more positive feel and selection. A seperate pushbutton will be required for selection. Regarding the pots.... I think you would have to account for hysterisis in your code as there is not the demarcation of clicks between the various states.
|
|
|
|
« Last Edit: February 01, 2013, 06:45:59 pm by lemming »
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Online
Brattain Member
Karma: 279
Posts: 15327
Measurement changes behavior
|
 |
« Reply #29 on: February 01, 2013, 07:00:40 pm » |
These rotary encoders also embody a select switch by pressing down on the knob. (appologies for being a Sparkfun tart yet again). https://www.sparkfun.com/products/9117However, having programmed a few of these menu systems using various rotary encoders (use a four line LCD for clarity of the scrolling menus in the users mind rather than the two line) I find that these type of units have fairly fine dentents (or 'dents'). It can make it easy to overshoot. The cheap mechanical encoders suffer from pretty bad contact bounce and detent positioning that doesn't always seem to line up with the electrical signal transition positions. They can be made to work with lots of software fussing, but optical or magnetic encoders are a whole lot easier to live with.One of those clunky rotary switches (with resistors soldered between the tabs) will have a more positive feel and selection. A seperate pushbutton will be required for selection. Regarding the pots.... I think you would have to account for hysterisis in your code as there is not the demarcation of clicks between the various states. By reading a 10 bit pot value and shifting the results right allows a much lower number of possible count possibilities, the problem of hysteresis or small count variations becomes a non problem. It's all about how many different values do you need from the pot as a ratio of 1023 possibilities. If you need only two value possibilities you shift the analogRead() results 9 bits right and the pot can only be seen as returning a 1 or 0 value, with the actual change being done at the 50% pot travel position. Lefty
|
|
|
|
|
Logged
|
|
|
|
|
|