pololu wheel encoder

hi. i'm facing some difficulties to program for pololu wheel encoder.is there any simple example that i can refer to?

thereisawholesectionintheplaygrounddealingwithencoders: http://playground.arduino.cc//Main/RotaryEncoders

If you can't be bothered with capital letters and spaces, I can't either.

No code, no links to the product pages, no help from us. Read the sticky note at the top of the forum!

I'm sorry. I would like to ask can pololu wheel encoder http://www.pololu.com/catalog/product/1217 be program without using interrupt. Because I'm planning to receive data at the same time. For your information, I'm using Uno.

Yes it can. The question is, can it be done without interrupts and be responsive enough to do what you want it to do (which we don't know because we aren't psychic), and will it work without interrupts in your code (which we can't tell you as, again, we aren't psychic.)

bardoot: I'm sorry. I would like to ask can pololu wheel encoder http://www.pololu.com/catalog/product/1217 be program without using interrupt. Because I'm planning to receive data at the same time. For your information, I'm using Uno.

My advice is to not use the AVR library code supplied by polulo, at least for the wheel encoders. I glanced at it, and it's not reliable code. It clears and enables interrupts without bothering to remember the prior state. It also blindly clears all PCINT flags in the ISR. That should result in all kinds of fun problems. That's what I immediately saw, I'm sure it gets worse.

There is no reason that you shouldn't be able to do communcations and handle the wheel encoder with an ISR, unless you are using SoftwareSerial.

You may find the PinChangeInt library useful. I have used this in the past to handle rotary encoders, and it's worked well.

Where can I download library for PinChangeInt? I try to run example program for PinChangeInt. Here the program

    /*
    Copyright 2011 Lex.V.Talionis at gmail
    This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
    */
    #include <PinChangeInt.h>
    #include <PinChangeIntConfig.h>
     
    #define PIN 15  // the pin we are interested in
    volatile byte burp=0;    // a counter to see how many times the pin has changed
    byte cmd=0;     // a place to put our serial data
     
    void setup() {
      Serial.begin(9600);
      Serial.print("PinChangeInt test on pin ");
      Serial.print(PIN);
      Serial.println();
      pinMode(PIN, INPUT);     //set the pin to input
      digitalWrite(PIN, HIGH); //use the internal pullup resistor
      PCintPort::attachInterrupt(PIN, burpcount,RISING); // attach a PinChange Interrupt to our pin on the rising edge
    // (RISING, FALLING and CHANGE all work with this library)
    // and execute the function burpcount when that pin changes
      }
     
    void loop() {
      cmd=Serial.read();  
      if (cmd=='p')
      {
        Serial.print("burpcount:\t");
        Serial.println(burp, DEC);
      }
      cmd=0;
    }
     
    void burpcount()
    {
      burp++;
    }

And it say PCintPort not declare. I guess it because I dont have the library.

See http://playground.arduino.cc/Main/PinChangeInt , which you have already visited to get the example code

To download the current version, more documentation or to report bugs please check out our Google Code Group (https://code.google.com/p/arduino-pinchangeint/downloads/list)

I have try the programming and it work fine. But I stuck at how to decrease when it rotate backward. Any one can help me with the problem? I am really appreciate it. If have example would be great. Thanks

What is it that you want to decrease when it (what is 'it' ?) backwards ? If you want to know which a wheel is rotating then you need to be able to read 2 sensors on the encoder. The 2 sensors produce a pattern that can be used to determine not only the rotational speed of the wheel but its direction. Search for quadrature encoders for an explanation of how it works.