Resources » Pololu AVR C/C++ Library User's Guide »4. Using the Pololu AVR Library for your own projectsAfter getting one of the example projects to work with an Orangutan controller or 3pi robot, you can start working on more complicated programs of your own. The library provides easy access to all of the features of the Orangutans and 3pi, including the LCD screen, buttons, LEDs, motors, and buzzer. There are also functions in the library that make it easy for you to do more general-purpose operations with the AVR, such as timing and analog-to-digital conversion. The library also provides support for the Pololu QTR sensors and the Pololu Wheel Encoders (it should actually work for quadrature encoders in general). For a complete list of functions provided by the library, see the command reference. Usually, the easiest way to adapt this code to your own projects will be to start with a working example and gradually add the things that you need, one step at a time. For Atmel Studio 6 users, we recommend using the New Project templates installed by the library, which are documented in the Pololu AVR Programming Quick Start Guide. However, if you want to start from scratch, there are just a few things that you need to know. First, to use the library with C, you must place one of the following lines C#include <pololu/orangutan.h> #include <pololu/3pi.h> #include <pololu/qtr.h> #include <pololu/encoders.h> at the top of any C file that uses functions provided by the library. To use the library with C++, the equivalent lines are C++#include <pololu/orangutan> #include <pololu/Pololu3pi.h> #include <pololu/PololuQTRSensors.h> #include <pololu/PololuWheelEncoders.h> The line or lines that you include depend on which product you are using with the library. Second, when compiling, you must link your object files with the appropriate To add the Note:
Finally, we also strongly recommend the linker option
Special option necessary for Orangutan X2If you are using one of the newer Orangutan X2s that comes with a ATmega1284p processor, you must define the
|
|
Log In
|
Wish Lists
|
BIG Order Form
|
Shopping Cart
US toll free: 1-877-7-POLOLU ~
(702) 262-6648 |
|||||||||||||
| Catalog | Forum | Resources | Distributors | Ordering | About | Contact | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|