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:
22:66401b612b1b
Parent:
21:87a2227c1ad2
Child:
25:caf134ebfc34
--- a/uOLED.cpp	Sun Dec 26 18:49:00 2010 +0000
+++ b/uOLED.cpp	Sun Dec 26 19:25:23 2010 +0000
@@ -243,13 +243,16 @@
     return (_oled.getc() == OLED_ACK);
 }
 
-bool uOLED::putPixel(char x, char y, short color) {
+bool uOLED::putPixel(char x, char y, short red, short green, short blue)
+{
+    short colour = getRGB(red, green, blue);
+
     _oled.putc(0x50);
     _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);
 }
@@ -278,23 +281,27 @@
     return (_oled.getc() == OLED_ACK);
 }
 
-bool uOLED::setFontSize(char fontType) {
+bool uOLED::setFont(char font) {
     _oled.putc(0x46);
-    _oled.putc(fontType);
+    _oled.putc(font);
     
     return (_oled.getc() == OLED_ACK);
 }
 
-bool uOLED::textButton(char state, char x, char y, short buttonColor, char font, short textColor, char textWidth, char textHeight, char *text) {
+bool uOLED::textButton(char state, char x, char y, short red, short green, short blue, char font, short textRed, short textGreen, short textBlue, char textWidth, char textHeight, char *text)
+{
+    short buttonColour = getRGB(red, green, blue);
+    short textColour = getRGB(textRed, textGreen, textBlue);
+
     _oled.putc(0x62);
     _oled.putc(state);
     _oled.putc(x);
     _oled.putc(y);
-    _oled.putc(buttonColor >> 8);
-    _oled.putc(buttonColor & 0xFF);
+    _oled.putc(buttonColour >> 8);
+    _oled.putc(buttonColour & 0xFF);
     _oled.putc(font);
-    _oled.putc(textColor >> 8);
-    _oled.putc(textColor & 0xFF);
+    _oled.putc(textColour >> 8);
+    _oled.putc(textColour & 0xFF);
     _oled.putc(textWidth);
     _oled.putc(textHeight);
     for (int i=0 ; i<strlen(text) ; i++) _oled.putc(text[i]);