User Manual

#include <pololu/orangutan.h>
// get random functions
#include <stdlib.h>
/*
* lcd2: for the Orangutan controllers and 3pi robot
*
* This example uses the OrangutanLCD functions to display custom
* characters on the LCD. Simply push a any user pushbutton to
* display a new, randomly chosen, custom mood character.
*
* http://www.pololu.com/docs/0J20
* http://www.pololu.com
* http://forum.pololu.com
*/
// define some custom "mood" characters
#include <avr/pgmspace.h> // this lets us refer to data in program space (i.e. flash)
const char happy[] PROGMEM = {
0b00000, // the five bits that make up the top row of the 5x8 character
0b01010,
0b01010,
0b01010,
0b00000,
0b10001,
0b01110,
0b00000
};
const char sad[] PROGMEM = {
0b00000,
0b01010,
0b01010,
0b01010,
0b00000,
0b01110,
0b10001,
0b00000
};
const char indifferent[] PROGMEM = {
0b00000,
0b01010,
0b01010,
0b01010,
0b00000,
0b00000,
0b01110,
0b00000
};
const char surprised[] PROGMEM = {
0b00000,
0b01010,
0b01010,
0b00000,
0b01110,
0b10001,
0b10001,
0b01110
};
const char mocking[] PROGMEM = {
0b00000,
0b01010,
0b01010,
0b01010,
0b00000,
0b11111,
0b00101,
0b00010
};
char prevMood = 5;
Pololu AVR C/C++ Library Users Guide © 2001–2015 Pololu Corporation
3. Functional Overview and Example programs Page 18 of 43