Information
OS - Windows 7
Arduino - Arduino Uno r3
Details - So I tried running a small piece of code on the arduino, everything was working fine. Then towards the end of uploading, a message popped up. It said, Error opening serial port. And there was a drop down asking e to pic a different com port. I went to Devices and printers and the arduino was responsive and was shown as com port 11. I tried again but to no avail. Please help. Any responses are appreciated.
Here is the code I was running. It's the basic sweep example with a small modification.
// Sweep
// by BARRAGAN http://barraganstudio.com
// This example code is in the public domain.
#include <Servo.h>
Servo myservo;
Servo myservo2;// create servo object to control a servo
// 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 < 360; pos += 1) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos);
myservo2.write(pos);// tell servo to go to position in variable 'pos'
delay(15); // 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);
myservo2.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}