Stepper Motor + M542T Microstep Driver + 10k Pot

First off I would like to say thank you for helping this Noob with this issue.

Currently I have a 10k Pot controlling the speed of my Stepper Motor, my issue is
when the Pot is at 0 the motor still spins at a very low speed.

I would like to have the motor not moving at 0.

Connections to my board

8 - Step
9 - Dir

pot - 5v
pot - A3
pot - GND

My programming skills are very limited so im sure this will be the problem. Can someone help sort out this small issue.

int sensorPin = A3;
int sensorValue = 0;

void setup () {
	pinMode(8, OUTPUT);       //direction pin
 	pinMode(9, OUTPUT);  //step pin
	digitalWrite(8, LOW);
	digitalWrite(9, LOW);
}

void loop ()  {
	sensorValue = analogRead(sensorPin);
	sensorValue = map(sensorValue,0,1023,3600,1);
	digitalWrite(9, HIGH);
	delayMicroseconds(sensorValue);
	digitalWrite(9, LOW);
	delayMicroseconds(sensorValue);
}

Thanks for you patience

Try this:

void loop ()  {
  sensorValue = analogRead(sensorPin);
  if(sensorValue > 5) //adjust for lowest value
  {
    sensorValue = map(sensorValue, 0, 1023, 3600, 1);
    digitalWrite(9, HIGH);
    delayMicroseconds(sensorValue);
    digitalWrite(9, LOW);
    delayMicroseconds(sensorValue);
  }
}

Worked. Legend :slight_smile:

@Laura721, this seems to be the 3rd place where you have asked the same question.

Do NOT double post - it just wastes everyone's time.

Click Report to Moderator and ask to have you questions merged into one place.

...R