Wheel encoder and yun

Hi

I have a yun board and a motor shield, with two motors. I have encoder for pololu wheel 42x19 mm, just for the A motor, in order to test.
I have downloaded libpololu-avr library and copied PololuWheelEncoders, OrangutanResources and OrangutanDigital diretories to Arduino\libraries.
I have written the simple code:

#include <PololuWheelEncoders.h>

PololuWheelEncoders encoder;

void setup() 
{
  encoder.init(4,5,255,255);
  
  Serial.begin(9600);
}
void loop()
 {
  writeCounter();
  delay(100);
}

//capture encoder counts.
void writeCounter() 
{
  Serial.println( encoder.getCountsM1(), DEC );
}

But … it always shows 0.

Is PololuWheelEncoders libraries Yun compatible? Is there any problem with attachInterrupt?

Thanks for helping.

Hello.

Unfortunately, the PololuWheelEncoder library does not work with the Yun. However, you should be able to read those boards with other encoder libraries that work with the Yun.

-Jon

Jonathan

Could you say me one of these libraries?

Dou you know wether it is posible to read encoder inputs signal without using attachInterrup function, because signals are very fast sent, and Arduino cannot read all of them?

Regards

Unfortunately, I do not know where you can find encoder libraries for the Yun. However, using encoders is common in robotics, so I expect them to be available online.

Generally, interrupts are used because encoder counts need to be read quickly, but if you do not need to read encoder counts very often, you probably do not need to use the interrupts.

-Jon

Thanks