I know how to program a servo so it moves to a position while you're holding a button, but what I want to know is if it's possible to make a servo move a certain number of degrees each time you tap a button? Like if I were to push Joy2Btn(2) once, how would I get the servo to move 90 degrees and then stop until I pressed it again?
Thanks in advance for the help!
Fri Nov 04, 2011 10:55 pm
magicode
Moderator
Joined: Tue Sep 14, 2010 9:19 pm Posts: 495
Re: Progressive servo movement
Well, here's a pseudo code example to get you started:
Code:
while(true){ if button is pressed, servo = servovalue + numdegrees while(button is pressed){} }
Users browsing this forum: No registered users and 2 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum