I always get the error message saying Problem uploading to Board

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/home/10666854/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
         User configuration file is "/home/10666854/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: ser_open(): can't open device "/dev/ttyACM0": No such file or directory

avrdude done.  Thank you.

Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
Board at /dev/ttyACM0 is not available

Can anyone help me with this please i am facing this error a lot of time and the code was for PS4 Controller code is:

#include <Keyboard.h>  // Use built-in Keyboard library
#include <HID_Buttons.h>  // Must import AFTER Keyboard.h
#include <Mouse.h>

const uint8_t Pin_XAxis = A0;  // Pin for joy horizontal axis
const uint8_t Pin_YAxis = A1;  // Pin for joy vertical axis

const int JoyCenter   = 1023 / 2;  // max value for 10-bit ADC / 2
const int JoyDeadzone = 50;        // +/- area around the center to ignore

int horzPin = A2;  // Analog output of horizontal joystick pin
int vertPin = A3;  // Analog output of vertical joystick pin
int selPin = 9;  // select button pin of joystick

int vertZero, horzZero;  // Stores the initial value of each axis, usually around 512
int vertValue, horzValue;  // Stores current analog output of each axis
const int sensitivity = 200;  // Higher sensitivity value = slower mouse, should be <= about 500
int mouseClickFlag = 0;

//int invertMouse = 1;        //Invert joystick based on orientation
int invertMouse = -1;         //Noninverted joystick based on orientation


KeyboardButton moveForward('W');
KeyboardButton moveLeft('A');
KeyboardButton moveBackward('S');
KeyboardButton moveRight('D');

void setup() {
  Keyboard.begin();
  Serial.begin(9600);
  pinMode(horzPin, INPUT);  // Set both analog pins as inputs
  pinMode(vertPin, INPUT);
  pinMode(selPin, INPUT);  // set button select pin as input
  digitalWrite(selPin, HIGH);  // Pull button select pin high
  delay(1000);  // short delay to let outputs settle
  vertZero = analogRead(vertPin);  // get the initial values
  horzZero = analogRead(horzPin);  // Joystick should be in neutral position when reading these

  Mouse.begin(); //Init mouse emulation
}

void loop() {
  int x = analogRead(Pin_XAxis);  // Read X axis
  int y = analogRead(Pin_YAxis);  // Read Y axis

  moveLeft.set(x < JoyCenter - JoyDeadzone);
  moveRight.set(x > JoyCenter + JoyDeadzone);

  moveForward.set(y < JoyCenter - JoyDeadzone);
  moveBackward.set(y > JoyCenter + JoyDeadzone);
  
  vertValue = analogRead(vertPin) - vertZero;  // read vertical offset
  horzValue = analogRead(horzPin) - horzZero;  // read horizontal offset
  if ()
  if (vertValue != 0)
  {
    Mouse.move(0, (invertMouse * (vertValue / sensitivity)), 0); // move mouse on y axis
  }
  if (horzValue != 0)
  {
    Mouse.move((invertMouse * (horzValue / sensitivity)), 0, 0); // move mouse on x axis
  }

  if ((digitalRead(selPin) == 0) && (!mouseClickFlag))  // if the joystick button is pressed
  {
    mouseClickFlag = 1;
    Mouse.press(MOUSE_LEFT);  // click the left button down
    Serial.println("Joystick button is clicked");
  }
  else if ((digitalRead(selPin)) && (mouseClickFlag)) // if the joystick button is not pressed
  {
    mouseClickFlag = 0;
    Mouse.release(MOUSE_LEFT);  // release the left button
    Serial.println("Joystick button is released");

  }
}

i also got another error newly:

processing.app.debug.RunnerException
	at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:152)
	at cc.arduino.UploaderUtils.upload(UploaderUtils.java:77)
	at processing.app.SketchController.upload(SketchController.java:732)
	at processing.app.SketchController.exportApplet(SketchController.java:703)
	at processing.app.Editor$UploadHandler.run(Editor.java:2055)
	at java.lang.Thread.run(Thread.java:748)
Caused by: processing.app.SerialException: Error touching serial port '/dev/ttyACM0'.
	at processing.app.Serial.touchForCDCReset(Serial.java:107)
	at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:136)
	... 5 more
Caused by: jssc.SerialPortException: Port name - /dev/ttyACM0; Method name - openPort(); Exception type - Permission denied.
	at jssc.SerialPort.openPort(SerialPort.java:170)
	at processing.app.Serial.touchForCDCReset(Serial.java:101)
	... 6 more

Does that port exist on your system ?

Did you select the right serial port in the IDE Tools menu, Ports item?
See this page.
Or this page.

Would the message be on a Raspberry Pi? You may have to open that port up, on the RPi.

I have the port in my computer

the problem i get is given below:

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/home/10666854/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
         User configuration file is "/home/10666854/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         Using Programmer              : avr109
         Overriding Baud Rate          : 57600
avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied

avrdude done.  Thank you.

Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

No its on arduino uno and arduino leonardo

@groundFungus Of course dude!

It’s not clear what you mean by that. Did you try following all the instructions at the first page groundFungus linked to?

yea i checked @pert but none worked i also tried ’ chmod 777 “my port name” ’ in terminal

It could be caused by an application named “modemmanager” taking over the port. There is a script in the root folder of the Arduino IDE installation that takes the “shotgun approach” to configuring a Linux system to work with Arduino boards. You could try running that. You might want to take a look at it. It’s also here if that’s more accessible for interested parties to have a browse:

How do i run this in my Arduino IDE

You don’t. It’s a Bash script. You need to run it from the terminal of your operating system.