User Manual

Usage Examples
This library comes with an example sketch that you can load by going to File > Examples >
OrangutanLEDs.
1. OrangutanLEDExample
Alternately blinks the red and green LEDs on the Orangutan SV-xx8, Orangutan LV-168, or 3pi robot.
If you run this program on the Baby Orangutan B, you will only see the red user LED blink, but you can
connect an external LED to pin PD7 (Arduino pin 7) if you want to see the second LED blink. If you do
this, don’t forget to include a current-limiting resistor!
5.e. OrangutanMotors - Motor Control Library
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <OrangutanLEDs.h>
/*
* OrangutanLEDExample: for the 3pi robot, Orangutan LV 168, Orangutan SV-xx8,
* 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).
*/
OrangutanLEDs leds;
void setup() // run once, when the sketch starts
{
}
void loop() // run over and over again
{
leds.red(HIGH); // red LED on
delay(1000); // waits for a second
leds.red(LOW); // red LED off
delay(1000); // waits for a second
leds.green(HIGH); // green LED on (will not work on the Baby Orangutan)
delay(500); // waits for 0.5 seconds
leds.green(LOW); // green LED off (will not work on the Baby Orangutan)
delay(500); // waits for 0.5 seconds
}
?
Programming Orangutans and the 3pi Robot from the Arduino
Environment
© 2001–2019 Pololu
Corporation
5. Arduino Libraries for the Orangutan and 3pi Robot Page 55 of 66