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
Revision 13:f2b9f249bcff, committed 2010-12-20
- Comitter:
- Nakor
- Date:
- Mon Dec 20 20:49:25 2010 +0000
- Parent:
- 12:59da6ae5cfb7
- Child:
- 14:3d90211095d4
- Commit message:
Changed in this revision
uOLED.cpp | Show annotated file Show diff for this revision Revisions of this file |
uOLED.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/uOLED.cpp Mon Dec 20 20:33:36 2010 +0000 +++ b/uOLED.cpp Mon Dec 20 20:49:25 2010 +0000 @@ -238,16 +238,18 @@ return returnValue; } -bool uOLED::setBackgroundColor(short color) { - _oled.putc(0x42); - +bool uOLED::setBackgroundColour(char red, char green, char blue) +{ + int outR = ((red * 31) / 255); + int outG = ((green * 63) / 255); + int outB = ((blue * 31) / 255); - _oled.putc(color >> 8); - _oled.putc(color & 0xFF); + short colour = (outR << 11) | (outG << 5) | outB; + + _oled.putc(0x42); - - //_oled.putc(colorA); - //_oled.putc(colorB); + _oled.putc(colour >> 8); + _oled.putc(colour & 0xFF); return (_oled.getc() == OLED_ACK); }
--- a/uOLED.h Mon Dec 20 20:33:36 2010 +0000 +++ b/uOLED.h Mon Dec 20 20:49:25 2010 +0000 @@ -157,10 +157,11 @@ short readPixel(char x, char y); /** Replaces the background colour with a new colour. * - * @param colorA First hex number of colour. (00 ~ FF) - * @param colorB Second hex number of colour. (00 ~ FF) + * @param red Red value (0 to 255). + * @param green Green value (0 to 255). + * @param blue Blue value (0 to 255). */ - bool setBackgroundColor(short color); + bool setBackgroundColour(char red, char green, char blue); /** Dunno19 * Dunno * @param returns something.