Go Down

Topic: Issues with moving a servo (Read 70 times) previous topic - next topic

randomnoob2

I am trying to make a servo turn 180 degrees, and it compiles but there is an issue with uploading which I assume is attributed to the addition of the motor controller:

Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "Arduino/Genuino Uno"

Sketch uses 2152 bytes (6%) of program storage space. Maximum is 32256 bytes.
Global variables use 50 bytes (2%) of dynamic memory, leaving 1998 bytes for local variables. Maximum is 2048 bytes.
avrdude: ser_open(): can't set com-state for "\\.\COM3"
An error occurred while uploading the sketch

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Is this a noob error or what? I put on my motor controller and plugged the servo onto the correspoding pins, and it did a quick little turn but just for a second. I followed a little tutorial and from what I know I put the right wires into the right spot on the arduino without the motor controller, but I'm not sure. Here is my code:

#include <Servo.h>
int servoPin=3;
Servo Servo1;
void setup(){
Servo1.attach(servoPin);
}
void loop(){
Servo1.write(0);
delay(2000);
Servo1.write(45);
delay(1000);
Servo1.write(90);
delay(1000);
Servo1.write(180);
delay(1000);
}

Any help for a noob is welcome.

UKHeliBob

Code: [Select]
avrdude: ser_open(): can't set com-state for "\\.\COM3"Which port have you got selected in the Tools/Port menu in the IDE ?
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

pert

Is this the same motor shield you posted about causing this problem back in 2016?
http://forum.arduino.cc/index.php?topic=434865

Go Up