Help with 2 steppermotors controlled by potentiometers

Do you have your pots wired up just like that Wokwi sim? With nothing but the wipers connected?

If that's the case, they are just floating inputs and will give random results.

The GNDs on the pots should be connected to the GND pin and their VCCs should be connected to the 5V pin. Like this:

image

The 100% speed = 10steps/sec and 10%=1000steps/sec code makes my head hurt.