This is the error message i get. I uploaded sketch twice in the same board this morning but suddenly its not uploading now.
This is the sketch i'm using :
// Define pin connections & motor's steps per revolution
const int dirPin = 2;
const int stepPin = 3;
const int stepsPerRevolution = 6400;
#define M_ZERO 4
#define M_ONE 5
#define M_TWO 6
void setup()
{
// Declare pins as Outputs
pinMode(stepPin, OUTPUT);
pinMode(dirPin, OUTPUT);
pinMode(M_ZERO, OUTPUT);
pinMode(M_ONE, OUTPUT);
pinMode(M_TWO, OUTPUT);
// Here's the pin settings on the DRV8825 that determines the steps and how many steps is in one revolution
// M0 M1 M2 RESOLUTION
//------------------------------------------------
// LOW LOW LOW FULL STEP 1 Revolution 200 steps
// HIGH LOW LOW HALF STEP 1 Revolution 400 steps
// LOW HIGH LOW 1/4 STEP 1 Rrevolution 800 steps
// HIGH HIGH LOW 1/8 STEP 1 Rrevolution 1600 steps
// LOW LOW HIGH 1/16 STEP 1 Revolution 3200 steps
// HIGH LOW HIGH 1/32 STEP 1 Revolution 6400 steps 1500
digitalWrite(M_ZERO, HIGH); // Lets just start with a base line Full Step
digitalWrite(M_ONE, HIGH);
digitalWrite(M_TWO, HIGH);
}
void loop()
{
// Set motor direction clockwise
digitalWrite(dirPin, HIGH);
// Spin motor slowly
for (int x = 0; x < 30000; x++)
{
digitalWrite(stepPin, HIGH);
delayMicroseconds(500);
digitalWrite(stepPin, LOW);
delayMicroseconds(500);
}
delay(1000); // Wait a second
// Set motor direction counterclockwise
digitalWrite(dirPin, LOW);
// Spin motor quickly
for (int x = 0; x < 30000; x++)
{
digitalWrite(stepPin, HIGH);
delayMicroseconds(500);
digitalWrite(stepPin, LOW);
delayMicroseconds(500);
}
delay(1000); // Wait a second
}
Sketch uses 1086 bytes (3%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
avrdude: ser_open(): can't open device "\.\COM10": Access is denied.
Problem uploading to board. See https://support.arduino.cc/hc/en-us/sections/360003198300 for suggestions.