I have an Arduino Mega 2560 and what I want to accomplish is to move four CR servos by simply pressing a key on my keyboard. Is this possible? Any Help?
How is your keyboard connected to your arduino? Below is some simple test code for moving a servo based on the touching of two wires much like a keys/buttons.
//zoomkat servo button test 12-29-2011
int button1 = 4; //button pin, connect to ground to move servo
int press1 = 0;
int button2 = 5; //button pin, connect to ground to move servo
int press2 = 0;
digitalWrite(4, HIGH); //enable pullups to make pin high
digitalWrite(5, HIGH); //enable pullups to make pin high
press1 = digitalRead(button1);
if (press1 == LOW)
press2 = digitalRead(button2);
if (press2 == LOW)