User manual

LPCXpresso Experiment Kit - User’s Guide
Page 125
Copyright 2013 © Embedded Artists AB
// Purple => 32~47
...
// Cyan => 48~63
...
// Red => 64~79
...
// Green => 80~95
...
// Blue => 96~111
...
// Black => 112~127
...
}
int main (void)
{
draw_lcd_t lcd;
// outputs
GPIOSetDir(OLED_SSEL_PORT, OLED_SSEL_PIN, GPIO_OUTPUT);
GPIOSetDir(OLED_DC_PORT, OLED_DC_PIN, GPIO_OUTPUT);
GPIOSetDir(OLED_RESET_PORT, OLED_RESET_PIN, GPIO_OUTPUT);
GPIOSetValue(OLED_SSEL_PORT, OLED_SSEL_PIN, 1);
GPIOSetValue(OLED_DC_PORT, OLED_DC_PIN, 1);
GPIOSetValue(OLED_RESET_PORT, OLED_RESET_PIN, 1);
SSP0Init();
printf("\nInitializing oled driver...");
oled_init(&lcd);
rainbow(&lcd);
//enter forever loop -
while (1)
;
return 0;
}
Run the program and verify that a white bar is shown on the display. Now complete the rainbow
function to show 8 differently colored bars on the display.
Explore the other drawing primitives in the draw.c/h file.
Some possible improvements of the code base:
Increase the speed of the SPI bus to 6MHz (originally 1.5MHz)
Test the ssd1351_fadeIn(), ssd1351_fadeOut(), ssd1351_verticalScroll(),
ssd1351_horizontalScrol(), ssd1351_deactivateScroll() functions. Examples of usage can
be found in the software package that came with the OLED display module