Show Posts
Pages: [1]
1  Topics / Robotics / Re: Servos and Buttons on: November 16, 2012, 11:00:05 pm
well, what I really want to happen is when I push button 1,  servo 1 rotates to 90 deg. stays there for 200 milliseconds, then rotates to 50 deg. stays there for 200 milliseconds
then rotates to 180 deg. then finally stops there. Then when i press button 2, it does the same thing to servo 2 except the angles and timing are different. smiley-lol
2  Topics / Robotics / Re: Servos and Buttons on: November 14, 2012, 01:09:22 am
Thanks a lot zoomkat! ill give it a try! smiley-lol

Would I be able to apply this when I just want to use one button? For example, if I were to press Button 1, it will attach servo 9 turn it 90 degrees then detach it
then attach servo 11 turn it 90 degrees then detach it then stop? This seems really complicated for me smiley-roll-sweat
3  Topics / Robotics / Servos and Buttons on: November 13, 2012, 09:24:04 pm
Hey guys, im new to this whole arduino thing smiley-lol, i was just wondering if theres a way where an analog input button can
run a servo for just one loop, for example i want to run this just once when button 1 is pressed:

#include <Servo.h>

Servo myServo;

void setup() {
  myServo.write(180);   // Start at 180 degrees instead of 90
  myServo.attach(9);  // Attaches servo for turning
  myServo.attach(10); // Attaches servo for grabbing
  myServo.attach(11); // Attaches servo to raise arm

}

void loop() {
  myServo.attach(9);   // Attaches and apply power
  myServo.write(90);     // Position servo
  delay(300);    // Allow transit time
  myServo.detach();    // Detach and remove power
  delay(300);  
}
.....................

and this when button two is pressed:

 myServo.attach(11);   // Attaches and apply power
  myServo.write(90);     // Position servo
  delay(300);    // Allow transit time
  myServo.detach();    // Detach and remove power
  delay(300);  
}

is this even possible? any helpful thoughts would be much appreciated! Thanks!!  smiley-lol


  
Pages: [1]