DC motor with Rotary Encoder inside - help with wiring

I have 3 DC motors with internal rotary encoders. These motors have 6 wires= the pinout is +/VCC/A/B/GND/-

I also have 2 l298n dual h bridges.

I was wondering how to hook up these motors in order to power them and program through the h bridge, as well as know their position using the internal encoder. Do I need to hook up the A and B pinouts from the motor to 2 digital pins on my uno?

I am really strapped when it comes to digital pins on the uno, as 3 are required for each h bridge (A,B,PWM).


Also, is there any way to get around using the encoder?

Someone else will have to answer on the pinout, since to me on the face of it it seems + and Vcc are the same and GND and - are the same. I'm obviously wrong...

On the number of pins you have available: don't forget the analog pins work as digital as well. If you didn't know that, you've just scored 6 pins :) .

This thread of mine might help you understand encoders, although no guarantee yours work identically to mine.

You only need the encoder if you want to know how many "clicks" it's turned.