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

Files at this revision

API Documentation at this revision

Comitter:
Nakor
Date:
Tue Dec 21 00:35:49 2010 +0000
Parent:
13:f2b9f249bcff
Child:
15:06ef508fef4b
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:49:25 2010 +0000
+++ b/uOLED.cpp	Tue Dec 21 00:35:49 2010 +0000
@@ -174,6 +174,28 @@
     return (_oled.getc() == OLED_ACK);
 }
 
+bool uOLED::drawTextUF(char x, char y, char font, short red, short green, short blue, char width, char height, char *text) {
+    
+    int outR = ((red * 31) / 255);
+    int outG = ((green * 63) / 255);
+    int outB = ((blue * 31) / 255);
+    
+    short colour = (outR << 11) | (outG << 5) | outB;
+    
+    _oled.putc(0x53);
+    _oled.putc(x);
+    _oled.putc(y);
+    _oled.putc(font);   
+    _oled.putc(colour >> 8);
+    _oled.putc(colour & 0xFF);  
+    _oled.putc(width);
+    _oled.putc(height);
+    for (int i=0 ; i<strlen(text) ; i++) _oled.putc(text[i]);
+    _oled.putc(0x00);
+    
+    return (_oled.getc() == OLED_ACK);
+}
+
 bool uOLED::drawTriangle(char x1, char y1, char x2, char y2, char x3, char y3, short color) {
     _oled.putc(0x47);
     _oled.putc(x1);
--- a/uOLED.h	Mon Dec 20 20:49:25 2010 +0000
+++ b/uOLED.h	Tue Dec 21 00:35:49 2010 +0000
@@ -125,6 +125,25 @@
     * @endcode
     */
     bool drawText(char column, char row, char font, short color, char *text);
+    /** Draw unformated text to the screen.
+    * The manual describes this as "graphics format".
+    *
+    * @param x X coordinate for text placement.
+    * @param y Y coordinate for text placement.
+    * @param font Which font to use (Uses 0, 1, or 2).  More fonts can be added.
+    * @param red Amount of red in text colour RGB value.
+    * @param green Amount of green in text colour RGB value.
+    * @param blue Amount of blue in text colour RGB value.
+    * @param width Text width.
+    * @param height Text height.
+    * @param *text Character array (string) to be displayed.
+    *
+    * Example:
+    * @code
+    * SGC.drawText(0, 0, 0, FF, "This is text");
+    * @endcode
+    */
+    bool drawText(char x, char y, char font, short red, short green, short blue, char width, char height, char *text);
     /** Dunno13
     * Dunno
     * @param returns something.