First, you’ll need a multimeter to test the four son and detect groups (coils). Both son are connected together (which has a resistance) form a group.
In this example, the red and gray wire form a group (called group A). The yellow and green wire form the other group (called Group B).
Connect the Arduino and L298 as shown in the image and documented in the code comments below. Then, load your Arduino sketch.
Operation of motor No-by-step
A stepper motor to control not using 4 beats (in 4-stroke, 4-rhythms). Group A is connected to motorboat, Group B is connected to motorb.