diff --git a/README.md b/README.md index daede5c..ad90ffd 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,9 @@ the PC. The base controller requires the use of a motor controller and encoders * Pololu VNH5019 dual motor controller shield (http://www.pololu.com/catalog/product/2502) or Pololu MC33926 dual motor shield (http://www.pololu.com/catalog/product/2503). * Robogaia Mega Encoder shield -(http://www.robogaia.com/two-axis-encoder-counter-mega-shield-version-2.html). +(http://www.robogaia.com/two-axis-encoder-counter-mega-shield-version-2.html) or on-board wheel encoder counters. -**NOTE:** The Robogaia Mega Encoder shield can only be used with an Arduino Mega. +**NOTE:** The Robogaia Mega Encoder shield can only be used with an Arduino Mega. The on-board wheel encoder counters are currently only supported by Arduino Uno. * The library can be easily extended to include support for other motor controllers and encoder hardware or libraries. @@ -438,6 +438,31 @@ where id is the index of the servo as defined in the Arduino sketch (servos.h) a where id is the index of the servo as defined in the Arduino sketch (servos.h) +Using the on-board wheel encoder counters (Arduino Uno only) +------------------------------------------------------------ +The firmware supports on-board wheel encoder counters for Arduino Uno. +This allows connecting wheel encoders directly to the Arduino board, without the need for any additional wheel encoder counter equipment (such as a RoboGaia encoder shield). + +For speed, the code is directly addressing specific Atmega328p ports and interrupts, making this implementation Atmega328p (Arduino Uno) dependent. (It should be easy to adapt for other boards/AVR chips though.) + +To use the on-board wheel encoder counters, connect your wheel encoders to Arduino Uno as follows: + + Left wheel encoder A output -- Arduino UNO pin 2 + Left wheel encoder B output -- Arduino UNO pin 3 + + Right wheel encoder A output -- Arduino UNO pin A4 + Right wheel encoder B output -- Arduino UNO pin A5 + +Make the following changes in the ROSArduinoBridge sketch to disable the RoboGaia encoder shield, and enable the on-board one: + + /* The RoboGaia encoder shield */ + //#define ROBOGAIA + /* Encoders directly attached to Arduino board */ + #define ARDUINO_ENC_COUNTER + +Compile the changes and upload to your controller. + + NOTES ----- If you do not have the hardware required to run the base controller,