2 encoders without Interrupts

I'm working on a proyect with some friends, and I need to use 2 encoders in my Arduino Micro, with 2 DC motors, they ask me to record the speed of the motors using the encoders (Digital Magnetic Encoders: Pololu - Magnetic Encoder Pair Kit for Micro Metal Gearmotors, 12 CPR, 2.7-18V (old version) ). I look for it on internet and I ask some other students about it, and all they told me that the easiest way to use encoders was using Arduino's Interrupts, so I look for it, and indeed, it was easy, I starting using the Interrupts, but then I realize that the Interrupt pins of my arduino are, pins 0(RX),1(TX),2,3,7 but one of my friends is using the 0 and 1 pins, so I don't have enough pins to use my 2 encoders (I found that each encoder needs two Interrupt pins), also i realize that my friends is using these pins to constantly comunicate the arduino with the pc, usign a bluetooth module, that's a big problem for me, because I read that serial comunication don't allow me to use Interrupts.

:confused:

I've made so much researches about interrupts and encoders, and now i'm lost, the proyect needs to be ready for november of this year (2015) so I still have a little of time, but i'm afraid. That's why I made this question.

¿How can I use my 2 encoders with my single arduino Micro, and without Interrupts?
My goal is to record the speed of the motors

Encoders: Pololu - Magnetic Encoder Pair Kit for Micro Metal Gearmotors, 12 CPR, 2.7-18V (old version)
Motors: Pololu - 50:1 Micro Metal Gearmotor LP 6V
Arduino: https://www.arduino.cc/en/Main/arduinoBoardMicro

If you are only trying to record the speed of the motors and not needing maximum accuracy on position, then you could use an interrupt on only one pin of the encoder and read the second output to determine direction. You will only be reading 2 of the 4 available quadrature states. With the encoders you selected you will read 6 counts per revolution instead of 12.

The encoder read routine is very simple. You trigger on one channel of the encoder CHANGE, and read the value of both channels with digital read. If both channels are high or low, it is going in one direction, if they are opposite, its going in the other.

I understand that the micro will support pin change interrupts on the eight pins of PORTB. You will need to take a look at the documentation for the ATmega32U4. The Micro is at a disadvantage with respect to the ATmega328 based Arduinos, such as the Uno and Nano, who support pin change interrupts on most of their pins. If you need full encoder resolution I'd think you could find two additional pins on the Micro.

cattledog:
If you are only trying to record the speed of the motors and not needing maximum accuracy on position, then you could use an interrupt on only one pin of the encoder and read the second output to determine direction. You will only be reading 2 of the 4 available quadrature states. With the encoders you selected you will read 6 counts per revolution instead of 12.

The encoder read routine is very simple. You trigger on one channel of the encoder CHANGE, and read the value of both channels with digital read. If both channels are high or low, it is going in one direction, if they are opposite, its going in the other.

I understand that the micro will support pin change interrupts on the eight pins of PORTB. You will need to take a look at the documentation for the ATmega32U4. The Micro is at a disadvantage with respect to the ATmega328 based Arduinos, such as the Uno and Nano, who support pin change interrupts on most of their pins. If you need full encoder resolution I'd think you could find two additional pins on the Micro.

Thanks for your quick answer, I think I understand what you said, but if I use the Interruptions as you say, won't the serial communication be affected? the robot needs to be receiving and sending information to the computer, and I thought maybe the Interrupts could affect that.

If I use one Interrupt pin per encoder,will it affect the serial communication?

Thanks for your answer.

i realize that my friends is using these pins to constantly comunicate the arduino with the pc, usign a bluetooth module, that's a big problem for me, because I read that serial comunication don't allow me to use Interrupts.

If I use one Interrupt pin per encoder,will it affect the serial communication?

First, let me state that I am not very familiar with the 32U4 of the Micro and Leonardo. I assume you are talking about serial communication using the RX(0) and TX(1) pins and not the USB virtual (CDC) serial / COM port.

The hardware serial output is buffered, and should be compatible with interrupts being used on other pins.
I don't see your motors being fast enough or your ISR's so complex that interrupt processing will seriously impact the serial communication.

Still, you are talking about a robotic application with Bluetooth and I don't know what all the interactions will be. Get started, and experiment. You are wise to get his project started well in advance of November due date.