Heavily documented control library for the uOLED-96-G1 (SGC) by 4D Systems. Will likely work with any of the 4D Systems serial controlled screens. <<info>> All examples in the documentation have been tested to the best of my current abilities, but there are a few functions that I simply do not use. I have created a Lighthouse page for this library. You may submit bug reports or feature requests to [[http://mbed-uoled.lighthouseapp.com|this page]]. If you really do not wish to sign up for a Lighthouse account you may also post any bugs or requests [[/users/Nakor/notebook/uoled-bug-reports/|here]]. <</info>>
Dependents: DS18B20 DS18B20GSM Astromed Astromed_build20121123
Diff: uOLED.cpp
- Revision:
- 25:caf134ebfc34
- Parent:
- 22:66401b612b1b
- Child:
- 29:757036aa73cd
--- a/uOLED.cpp Sun Dec 26 19:42:52 2010 +0000 +++ b/uOLED.cpp Mon Dec 27 03:21:23 2010 +0000 @@ -65,24 +65,30 @@ return (_oled.getc() == OLED_ACK); } -bool uOLED::displayUserBitmappedCharacter(char character, char x, char y, short color) { +bool uOLED::displayUserBitmappedCharacter(char character, char x, char y, short red, short green, short blue) +{ + short colour = getRGB(red, green, blue); + _oled.putc(0x44); _oled.putc(character); _oled.putc(x); _oled.putc(y); - _oled.putc(color >> 8); - _oled.putc(color & 0xFF); + _oled.putc(colour >> 8); + _oled.putc(colour & 0xFF); return (_oled.getc() == OLED_ACK); } -bool uOLED::drawCharacter(char character, char column, char row, short color) { +bool uOLED::drawCharacter(char character, char column, char row, short red, short green, short blue) +{ + short colour = getRGB(red, green, blue); + _oled.putc(0x54); _oled.putc(character); _oled.putc(column); _oled.putc(row); - _oled.putc(color >> 8); - _oled.putc(color & 0xFF); + _oled.putc(colour >> 8); + _oled.putc(colour & 0xFF); return (_oled.getc() == OLED_ACK); } @@ -135,15 +141,17 @@ return (_oled.getc() == OLED_ACK); } -bool uOLED::drawPolygon(char vertices, char *x, char *y, short color) { +bool uOLED::drawPolygon(char vertices, char *x, char *y, short red, short green, short blue) { + short colour = getRGB(red, green, blue); + _oled.putc(0x67); _oled.putc(vertices); - for (int i=0; i<vertices; i++) { + for (int i=0; i < vertices; i++) { _oled.putc(x[i]); _oled.putc(y[i]); } - _oled.putc(color >> 8); - _oled.putc(color & 0xFF); + _oled.putc(colour >> 8); + _oled.putc(colour & 0xFF); return (_oled.getc() == OLED_ACK); }