Arduino Servo Motor

I am designing an Arduino servo Motor system where I am using a potentiometer to control the angle of the servo. How do I switch between record and play back? Also, how do i switch between loop and single play?

What have you tried so far? Post your code.

Since potentiometers can be varied at any time what exactly are you planning on recording and playing back and how often and where are you storing the recording?

Steve

In principle I would go for a state machine approach, starting in "idle" where nothing's happening. Then a button press could take you to "record mode". I've never tried to record a servo before but perhaps you could just stick the value into an array every . Then another button press to go to "playback" mode where every it could read the next value out of the array and move the servo

That might work, but I suspect the array will get big quite quickly.

One way or other this is likely to end up as a state machine, so if I were you I'd look at how to code one, not necessarily with the servo in play.

But as the previous reply said, what have you tried so far?

The absolute beauty of Arduino is that it can't harm to try anything (as long as you don't power the servo from the Arduino 5V :wink: ).... So even if you try my idea and it turns out to be total nonsense, it may jolt your thoughts in other directions.