Although I have in my drawers several motors from recycling printers, scanners, even old 5" ¼ floppy drives, I cannot find any driver to be able to carry out experiments with the new library incorporated into Annex32.
Being now with other projects and not imagining (at the moment) any really practical application for me of these motors, stops me from purchasing the motors you are using and their drivers.
But I also found a box with very cheap UNIPOLAR motors type 28-BYJ-48 and their corresponding ULN2803 controls and I couldn't resist the temptation of adapting to Annex32 an old code that I wrote in Bascom for AVR and I checked it works well in Annex.
Although the tests are done with an ESP8266, it should work equally well on ESP32.
It is a minimal code, only for demonstration, but in the ESP8266 I still have enough GPIOs to incorporate any sensor, mechanical or optical, that allows the program to know the exact position in space of the mechanical part associated with the motor, a kind of "home" to return to at any time. For example, when starting.
I am successfully using a tiny round magnet and a glass tube reed switch.
I copied the image of the ULN2003 controller and the 28BYJ-48 motor from the Fritzing forum.
https://youtu.be/KpC2g2prKME
Code: [Local Link Removed for Guests]
IN1 = 15
IN2 = 14
IN3 = 13
IN4 = 12
pin.mode IN1, output
pin.mode IN2, output
pin.mode IN3, output
pin.mode IN4, output
dim patern(7, 3)
for i = 0 to 7
READ patern$
for j = 1 to 4
patern(i, j-1) = val(mid$(patern$, j, 1))
next j
next i
do
move 4095, 0, 1
pause 2000
move 4095, 1, 1
pause 2000
loop
END
SUB move(steps, dir, speed)
LOCAL i, pos
if dir = 0 then pos = 0 else pos = 7
for i = 1 to steps
pin(IN1) = patern(pos, 0)
pin(IN2) = patern(pos, 1)
pin(IN3) = patern(pos, 2)
pin(IN4) = patern(pos, 3)
pause speed
if dir = 0 then pos = pos + 1 else pos = pos - 1
if pos = 8 then pos = 0
if pos = -1 then pos = 7
next i
END SUB
DATA "1000","1100","0100","0110","0010","0011","0001","1001"