Hello
Maybe my post was solved somewhere here, but cant find. Here is my problem.
I am new with arduino and trying to sweep two servo with the same angle.
.the blink example code causes the L led light to flash…
…uploading my own code causes the led to flash also… My both servos stop working when the L led starts blinking. Unpluging one of both servo wire on board causes the L led to be ON and the pluged servo is working fine. Seems like does not like both servo working at the same time.
what EXACTLY is it doing? flickering quickly, or flashing at a 1 second interval?
Any help will be appreciated
Here is my test code:
// Sweep
// by BARRAGAN http://barraganstudio.com
// This example code is in the public domain.
#include <Servo.h>
Servo myservo; // create servo object to control a servo
Servo myservo2; // a maximum of eight servo objects can be created
int pos = 0; // variable to store the servo position
void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
myservo2.attach(10);
}
void loop()
{
for(pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable ‘pos’
myservo2.write(pos);
delay(10); // waits 15ms for the servo to reach the position
}
for(pos = 180; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable ‘pos’
myservo2.write(pos);
delay(10); // waits 15ms for the servo to reach the position
}
}
Any help will be appreciated