stepper issue

hi everyone !
i"m learing how control a stepper motor, and i have a problem in the main loop. when pinValue == HIGH, i would like to have the motor spins counter clockwise in a while and then completely stop at a distance, but my code doesn’t work. here is it.

   void loop(){

  potValue = digitalRead(potPin);     // read the value of the potentiometer
  
   if  (potValue == HIGH)  
{ 
       motorSpeed=(1000);   // if potentiometer reads 0 to 535 do this
       counterclockwise();
 } 
   if ( potValue ==LOW)
  {
    clockwise();
}}

everyone who expert about arduino please help me out. i very appreciate that. thanks everyone.

click the MODIFY button in the upper right of the post window. Highlight all you code. click the "#" CODE TAGS button on the toolbar above just to the left of the QUOTE button. click SAVE (at the bottom). When you post code on the forum, please make a habit of using the code tags "#" button.

Post all of your code. That snippet is meangingless on its own.

...R

Better still reread the sticky threads about how to post here and follow the guidelines, then you'll likely get a complete and timely answer rather than a question and answer session. The more information you provide the more efficiently we can help.

Hi,

if (potValue == HIGH)

FirstGuess: You need something like if (potValue < 535)

But ShowUsTheCode!