Arduino with Wheel encoders


I just bought your wheels encoders (for dual shafts motors), i download the PololuWheelEncoders library but nothing …
The motor turn well, i measure an 1kHz frequency with a multimeter on pin OUT A but i have always the same result with encoders_get_counts_and_reset_m1() function : 0.

Here is my code (running on an arduino mini pro) :

[code]#define MOTOR_L_DIR 8
#define MOTOR_R_DIR 9

#define MOTOR_L_SPEED 10
#define MOTOR_R_SPEED 11

void setup() {
uint8_t i;

for(i = 8; i < 12; i++) {
	pinMode(i, OUTPUT);




void loop() {
uint8_t i;

digitalWrite(MOTOR_L_DIR, LOW);
digitalWrite(MOTOR_R_DIR, LOW);


Serial.print(" ");



I am sorry you are having trouble with the encoder library. I did not notice anything obviously wrong with your code. Can you tell me more about your setup? Specifically which encoder are you using? How are you supplying power? Can you post pictures of your setup that clearly show your connections?

Also, could you verify that you are using the correct version of the wheel encoder library? It is available in both a set of AVR libraries and a set of Arduino libraries; the Arduino libraries, which are downloaded from here, are the ones you should be using.