3.e. Orangutan LED Control Functions

Overview

These functions allow you to easily control the user LED(s) on the 3pi Robot, Orangutan SV, Orangutan SVP, Orangutan LV-168, and Baby Orangutan B. On the Orangutan SV-xx8 and LV-168, there are two user LEDs are on the top side of the PCB with the red LED on the bottom left and the green LED on the top right. On the 3pi, there are two user LEDs on the bottom side of the PCB with the red LED on the right (when looking at the bottom) and the green LED on the left. Additional LEDs included with the 3pi may be soldered in on the top side (in parallel with the surface-mount LEDs on the underside) for easier viewing. The Orangutan SVP has two user LEDs: a red LED on the bottom right and a green LED on the top left. The Baby Orangutan has a single red LED and no green LED.

Note that the red LED is on the same pin as the UART0 serial transmitter (PD1), so if you are using UART0 for serial transmission then the red LED commands will not work, and you will see the red LED blink briefly whenever data is transmitted on UART0. Note that the green LED is on the same pin as an LCD control pin; the green LED will blink briefly whenever data is sent to the LCD, but the two functions will otherwise not interfere with each other.

C++ users: See Section 5.d of Programming Orangutans and the 3pi Robot from the Arduino Environment for examples of this class in the Arduino environment, which is almost identical to C++.

Complete documentation of these functions can be found in Section 10 of the Pololu AVR Library Command Reference.

This library comes with an example program in libpololu-avr\examples.

1. led1

A simple example that blinks LEDs.

#include <pololu/orangutan.h>

/*
 * led1: for the 3pi robot, Orangutan LV 168, Orangutan SV-xx8, Orangutan SVP,
 *   or Baby Orangutan B
 *
 * This program uses the OrangutanLEDs functions to control the red and green 
 * LEDs on the 3pi robot or Orangutan.  It will also work to control the red
 * LED on the Baby Orangutan B (which lacks a second, green LED). 
 *
 * http://www.pololu.com/docs/0J20
 * http://www.pololu.com
 * http://forum.pololu.com
 */


int main()
{
  while(1)
  {
    red_led(1);               // red LED on
    delay_ms(1000);           // waits for a second
    red_led(0);               // red LED off
    delay_ms(1000);           // waits for a second
    green_led(1);             // green LED on (will not work on the Baby Orangutan)
    delay_ms(500);            // waits for 0.5 seconds
    green_led(0);             // green LED off (will not work on the Baby Orangutan)
    delay_ms(500);            // waits for 0.5 seconds
  }

  return 0;
}

Related Products

Encoder for Pololu Wheel 42x19mm
Pololu 42×19mm Wheel and Encoder Set
Orangutan SV-168 Robot Controller
Orangutan SVP-1284 Robot Controller (assembled)
Orangutan SVP-1284 Robot Controller (partial kit)
QTR-1RC Reflectance Sensor (2-Pack)
QTR-L-1A Reflectance Sensor (2-Pack)
QTR-L-1RC Reflectance Sensor (2-Pack)
QTR-3A Reflectance Sensor Array
QTR-3RC Reflectance Sensor Array
QTR-1RC Reflectance Sensor
QTR-1A Reflectance Sensor
QTR-1A Reflectance Sensor (2-Pack)
Orangutan SVP-324 Robot Controller (partial kit)
Orangutan SV-328 + USB Programmer Combo
Baby Orangutan B-328 Robot Controller
Orangutan SV-328 Robot Controller
Baby Orangutan B-328 + USB Programmer Combo
Baby Orangutan B-48 Robot Controller
QTR-8A Reflectance Sensor Array
QTR-8RC Reflectance Sensor Array
Pololu 3pi Robot
Baby Orangutan B-168 + USB Programmer Combo
Baby Orangutan B-48 + USB Programmer Combo
Orangutan LV-168 + USB Programmer Combo
Orangutan LV-168 Robot Controller
Orangutan SV-168 + USB Programmer Combo
Orangutan SVP-324 Robot Controller (assembled)
Orangutan LV-168 + USB Programmer Combo
Orangutan SV-328 + USB Programmer Combo
3pi Robot + USB Programmer + Cable Combo
Baby Orangutan B-48 + USB Programmer Combo
Baby Orangutan B-328 + USB AVR Programmer Combo
Orangutan X2 with VNH3
Log In
Pololu Robotics & Electronics
Shopping cart
(702) 262-6648
Same-day shipping, worldwide
Menu
Shop Blog Forum Support
My account Comments or questions? About Pololu Contact Ordering information Distributors