I've been digging a bit further in the howabouts of this type of servo,
and my code above is more complex than it should be.
There's no need to keep telling it the speed in the loop.
#include <Servo.h>
Servo myservo; // create servo object to control a servo
void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
myservo.write(100);
}
void loop()
{
// this space intentionally left blank
}
I've been digging a bit further in the howabouts of this type of servo,
and my code above is more complex than it should be.
There's no need to keep telling it the speed in the loop.
#include <Servo.h>
Servo myservo; // create servo object to control a servo
void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
myservo.write(100);
}
void loop()
{
// this space intentionally left blank
}
Top Comments
-
Jan Cumps
-
Cancel
-
Vote Up
0
Vote Down
-
-
Sign in to reply
-
More
-
Cancel
Comment-
Jan Cumps
-
Cancel
-
Vote Up
0
Vote Down
-
-
Sign in to reply
-
More
-
Cancel
Children