Stepper motor(24byj-48) doesn't rotate counterclockwise

Stepper motor is connected by ULN2003 module and takes power from arduino uno. After adding minus in function ‘stepper.setSpeed()’ stepper motor still rotates clockwise. I would even say that it sometimes stutters with negative number.
My program:

#include <AccelStepper.h>

AccelStepper stepper(4,8,9,10,11);

void setup() {
stepper.setMaxSpeed(500);
stepper.setSpeed(185.7535247400388); // I try to change it to (-185.7535247400388) but nothing
changes
}

void loop() {
stepper.runSpeed();
}

Are you sure you have the connections to the ULN2003 in the correct order?

Try giving the motor driver its own power supply - perhaps from a pack of 3 x AA alkaline cells (4.5v) with the battery GND connected to the Arduino GND.

What is the purpose of the oh-so-precise speed? When things don't work make the code as simple as possible - for example 180 steps per second.

I presume you know the speed is measured in steps per second.

...R

I've changed order of numbers from 11 to 8 in 'AccelStepper stepper(4,...)' and it started rotating counterclockwise. The reason i put so much precise number is I need it for star tracker and exact 1 degree per 4 minutes. I'll try with separate power supply. Thank you.

pitek123:
The reason i put so much precise number is I need it for star tracker and exact 1 degree per 4 minutes.

Don't worry about that sort of precision until you have everything working. Also, I think the float datatype in an Arduino is only accurate to 6 significant figures. If you need real precision use long or unsigned long integers.

...R

By the way can i use phone charger of output 5V and 1A to power this motor ? and may you know some other libraries with data types different than integer ? because I have that types of gears which don't give me speed of integer.

pitek123:
By the way can i use phone charger of output 5V and 1A to power this motor ?

It may be OK but 1 amp is probably marginal. Try it.

and may you know some other libraries with data types different than integer ? because I have that types of gears which don’t give me speed of integer.

If that means that you are wondering how to get fractional values using integers then you should think in terms of multiplying everything by 1000 (for 3 decimal points) or by 100,000 (5 decimal points). In other words 3.14159 could be represented as 314159

…R