CNC Shield with DRV8825 controlled with rotary encoder

Hello, I want to control a single stepper motor with a rotary encoder. I have all the parts required, I've successfully downloaded basic programs and made the stepper rotate using https://www.arduino.cc/en/Tutorial/LibraryExamples/StepperOneRevolution

I have just checked out the rotary encoder using a program I found working via the uln2003 driver and 28byj-48 5v stepper.

From that program I saw the Uno was taking the encoder signal on A4 and A5

I've checked and these correspond with SDA and SCL pins on top of the shield
I can also pick up 5v and gnd from the top of the shield for everything required for the encoder

I feel Ive got everything I need to start writing code but often after changing something fairly simple the program no longer works.

Appreciate any constructive pointers

Thanks, Jason

Checking the number of steps per revolution is a waist of time. Use the specs and let the stepper make its steps. Let it run 100 revolutions and check it stops at the correct position.

I dont need to check the number of steps, I just want to be able to move it with the encoder, I need precise control over the stepper, ideally with maximum resolution. The full range I need to turn the stepper is only 90 degrees. Just very precisely. I have reduced the gearing with a timing belt and 4:1 ratio reduction.

A stepper either moves exactly the steps it should or fail completely, stops any ware, standing still making noise. Use a stepper that has the torque needed.