The “secret” test program – Pololu Orangutan LV-xx8 User Manual

Page 12

Advertising
background image

7. Timer: A simple stopwatch. Press C to start or stop the stopwatch and A to reset. The stopwatch continues
to count while you are exploring the other demos.

The source code for the demo program is included with the

Pololu AVR C/C++ Library

[http://www.pololu.com/docs/

0J20]

. After downloading and unpacking the library zip file, the demo program can be found in the appropriate

examples\atmegaxx8\xV-xx8_demo_program

.

The “Secret” Test Program

The demo program contains a simpler test program that can be triggered if you hold one of the user pushbuttons
while resetting or turning on the controller. We use this program to test each Orangutan before it ships. When this
test program first begins running, the LCD will display a startup screen followed shortly by an interpretation of the
voltage on pin ADC6. On the Orangutan SV-xx8, this figure represents the current battery voltage in millivolts; on the
Orangutan LV-168, this figure represents the output of the temperature sensor in degrees Fahrenheit (if you touch the
board near the center you should see the temperature rise). From this point on, you can use the three user pushbuttons
to navigate through the three demo modes:

A Button: Motor Demo

Pushing the bottom user pushbutton (labeled PB1 on the back of the Orangutan PCB) will take you to the motor
demo, which alternates between driving motors 1 and 2 forward and reverse. First, the Orangutan gradually
ramps motor 1 from stationary to full-speed forward, to full-speed reverse, and back to stationary; motor 2 is
stationary during this entire phase. Next, the Orangutan repeats this process with motor 2 while motor 1 remains
stationary. The two motors alternate periods of activity like this for the duration of the demo. While motor 1 is
active, the red LED is lit, and while motor 2 is active the red LED is off. While the currently active motor is
moving forward, the green LED is lit, and while the currently active motor is moving in reverse, the green LED
is off. The LCD gives you feed back about which motor is moving in which direction: “F” = forward, “R” =
reverse, and “-” = inactive.

B Button: User I/O Demo

Pushing the middle user pushbutton (labeled PB4 on the back of the Orangutan PCB) will take you to the user
I/O demo, which makes use of the eight user I/O pins and the trimmer potentiometer. At any given time, one pin
is being driven low while the rest are weakly pulled high. At the same time, the LCD displays the input values
on the eight user I/O pins. If you short a pin to ground, you will see the corresponding bit on the LCD go to
zero. Pin PD1 will always read as low because it is being pulled down through the red user LED. The pin that
is driven low will repeatedly cycle from left to right and back again, “bouncing” back and forth from PC5 to
PD0 to PC5. The period of this cycle is determined by the position of the user potentiometer. You can connect
an LED between an I/O lines and power (make sure you use a current-limiting resistor!), and the LED will light
each time the pin it’s connected to is driven low.

Note: do not short a pin to power or else you could damage the ATmega168 microcontroller when
it tries to drive that pin low; only short it to one of the ground pins along the top edge of the board,
or use an LED in series with a resistor to connect to power.

C Button: Melody Demo

Pushing the top user pushbutton (labeled PB5 on the back of the Orangutan PCB) will take you to the melody
demo, in which the Orangutan plays a fugue on the buzzer while using high-frequency software PWM to
alternately fade the red and green user LEDs in and out. The demo program uses the Pololu AVR library to play

Pololu Orangutan SV-xx8 and LV-xx8 User's Guide

© 2001–2014 Pololu Corporation

5. Getting Started

Page 12 of 18

Advertising
This manual is related to the following products: