How do I control this stepper motor?
Encoder is a sensor that you use to determine position and speed of the motor.
In this case, it's a Quadrature Encoder, which outputs 2 square wave signals form the A &amp; B channels. These two signals has 90 degrees phase difference and it allows you to determine the direction of the rotation.
You connect A &amp; B signals coming from the encoder into the input pins of your uC. If you have supplied signals from your output pins, you may have damaged them.
Most of the times A &amp; B pins are open-drain outputs and need pull-up resistors to work.
BTW, it's not a stepper motor. It's just a permanent magnet brushed DC motor with a quadrature encoder.