Sample Code for the
Last Updated June 30, 2006
The following sample code is distributed under the
GNU General Public License.
This sample code (26k ZIP, updated 6-30-06)
is designed to work on Pololu's
Controller, running an Atmel ATmega8 AVR microcontroller at 8 MHz.
There are examples for using the LED, buttons, buzzer, LCD,
potentiometer (analog input), EEPROM, timer, and motor outputs.
The code uses C++ classes. If you have ever forgotten to set the direction
register for an output, or neglected to call a setup function to initialize
a counter, you'll appreciate that the class constructors automatically take
care of all the setup required for each object.
Some tips for using the code...
- Look at the code in main.cpp for examples of how to use the features
of the Orangutan (LCD, buttons, LED, etc).
- Look at the code in the .h files to see what each object can do.
You shouldn't need to modify the .h or .cpp files.
- Read the comment at the beginning of "makefile" to see what
commands you can specify.
- Use the "make setfuse" command to ensure that your microcontroller's
fuse bits are set for the sample code (e.g. 8 MHz processor speed).
You only need to do this once; the fuse bits are persistent.