0
votes

I recently bought myself a Arduino Uno board, connected to my computer installed the IDE and drivers. All went well, uploaded some scripts to my board, no problems at all. but now I am getting this error, can't get it off.

avrdude: ser_open(): can't open device "\\.\COM4": Access is denied.

I've checked into device manager if COM4 is still the right port, but it is indeed the right port, maybe my code is wrong? running out of ideas:3

int LED = 0;
int green = 1;

void setup() {
pinMode(LED, OUTPUT);
pinMode(green, OUTPUT);
}

void loop() {
  digitalWrite(LED, HIGH);
  delay(500);

  digitalWrite(LED, LOW);
  delay(500);

  digitalWrite(green, HIGH);
  delay(500);

  digitalWrite(green, LOW);
  delay(500);
}
1
Close any applications that might be using COM4. Also, try the Arduino on another computer, and see if a reboot fixes it.uint128_t

1 Answers

1
votes

Try to open the Serial comm port.
if it opens, short TX pin to RX pin.
send some data and check if you are getting the data back. this way you can make sure your usb-ttl is not damaged.
Make sure you have the right board selected under the Tools --> Board . Also, make sure you have the right port selected under Tools --> Comm