I’m programming a servo with a metal claw attached using a modified version of the “sweep” example servo code. It worked perfectly yesterday and was under the maximum amount of bytes. Today, however, all my sketches exceed 2,048 bytes, including the example codes for Servos. I get the error code “avrdude: ser_open(): can’t set com-state” every time. Is this an issue with my arduino size? Any comments are appreciated!
Sweep.2 (Modified Sweep Example Code):
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards
int pos = 0; // variable to store the servo position
void setup() {
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop() {
myservo.write(20); // tell servo to go to position in variable ‘pos’
delay(1000);
myservo.write(160); // tell servo to go to position in variable ‘pos’
delay(1000);
}