AVR Library Command Reference

void lcd_scroll(unsigned char direction, unsigned char num, unsigned int delay_time)
Shifts the display left or right by distance spaces, delaying for delay_time milliseconds between each shift. This
library defines literals LCD_LEFT and LCD_RIGHT for use as a direction argument to this method. Execution
does not return from this method until the shift is complete.
static void OrangutanLCD::loadCustomCharacter(const char *picture_ptr, unsigned char number)
void lcd_load_custom_character(const char *picture_ptr, unsigned char number)
Loads a custom character drawing into the memory of the LCD. The parameter ‘number’ is a character value
between 0 and 7, which represents the character that will be customized. That is, lcd.print((char)number) or
print_character(number) will display this drawing in the future.
Note: the clear() method must be called before these characters are used.
The pointer picture_ptr must be a pointer to an 8 byte array in program space containing the picture data. Bit 0
of byte 0 is the upper-right pixel of the 5×8 character, and bit 4 of byte 7 is the lower-left pixel. The example
below demonstrates how to construct this kind of array.
Example:
#include <avr/pgmspace.h>
// the PROGMEM macro comes from the pgmspace.h header file
// and causes the smile pointer to point to program memory instead
// of RAM
const char smile[] PROGMEM = {
0b00000,
0b01010,
0b01010,
0b01010,
0b00000,
0b10001,
0b01110,
0b00000
};
void setup()
{
// set character 3 to a smiley face
OrangutanLCD::loadCustomCharacter(smile, 3);
// clear the lcd (this must be done before we can use the above character)
OrangutanLCD::clear();
// display the character
OrangutanLCD::print((char)3);
}
Pololu AVR Library Command Reference © 2001–2009 Pololu Corporation
5. Orangutan LCD Page 15 of 35