I have a servo motor that i want to be programmed with a button. I haven't found anything to teach me wxactly what im looking for so if someone can refer me to a post or help me i would appreciate it! Basically there are 2 postions (up/down) i want the motor to learn with the press of a button. The same device can be used in many situations that require different up and down postions. So it would be nice if i could move the motor to the position i want then hold a button to program the up angle and likely need a different button to program the down position. Maybe a third button to initiate the learn phase first. If the servo is locked in a position hoping the 3rd button would set it free to allow me to move it to the position i want followed by holding the appropriate button for up/down(whichever is desired)
Your program commands the servo arm to move to a certain position.
Most servos have no capability to report the position of the output shaft, and do not tolerate the shaft being forced into a new position. In fact the servo will burn out if you try.
A brushed DC gearmotor with motor driver and shaft encoder could be programmed to do what you want.
Dang, i had it set up where telling google would set positions but im hoping to get a wifi free setup. I appreciate the help. Ill look into the parts and see how far i can get. Ill likely report back with more questions. Thanks again!!
I think i replied to myself instead of you. Basically i was just sayin thanks lol but had another thought. Would using a potentiometer work? Code it to read the potentiometer when a button is clicked or held? Then a second/third button to learn up/down?
Yes. The analog read function, with a pot applied to the analog input, gives you a value between 0 and 1023, which the map function can scale to 0 to 180 (degrees) for servo control.
yeah no if you meant manually move it.
You could have a few buttons to move the servo into position CW and CCW, then a button to store the value.
Programming reset woukd mean waiting for two values stored, the larger would be the high value
a7
12 posts were split to a new topic: One Button User Interface
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.