Library for EarthLCD ezLCD3xx line of products
Diff: ezLCDLib.cpp
- Revision:
- 6:83cada1140d4
- Parent:
- 5:4a6254e2012f
--- a/ezLCDLib.cpp Thu May 02 02:32:26 2013 +0000 +++ b/ezLCDLib.cpp Mon May 13 18:00:23 2013 +0000 @@ -126,7 +126,7 @@ *str++ = c; } timeOut++; - } while(c!='\r' && timeOut != 0xfffff); + } while(c!='\r' && timeOut != 0xfffffff); *str--; *str = 0; } @@ -136,7 +136,7 @@ char c=0; unsigned long timeOut=0; while(rx_in == rx_out) { - if(timeOut++ > 0xfffff) return false; + if(timeOut++ > 0xffffff) return false; } c=rx_buffer[rx_out]; rx_out = (rx_out + 1) % buffer_size; @@ -249,13 +249,13 @@ waitForCR(); } -void ezLCD3::box(int x, int y, bool filled) +void ezLCD3::box(int width, int heigth, bool filled) { sendInt(Box); _ser.putc(' '); - sendInt(x); + sendInt(width); _ser.putc(' '); - sendInt(y); + sendInt(heigth); if(filled) { _ser.putc(' '); _ser.putc('f'); @@ -264,15 +264,13 @@ waitForCR(); } -void ezLCD3::light(int i) +void ezLCD3::light(int level) { - if (i >= 0 && i <= 100) { - sendInt(Light); + sendInt( Light ); putc(' '); - sendInt( i ); + sendInt( level ); putc('\r'); waitForCR(); - } } int ezLCD3::getXmax( void ) @@ -342,6 +340,17 @@ waitForCR(); } +void ezLCD3::fontw( int ID, int font) +{ + sendInt(Fontw); + _ser.putc(' '); + sendInt(ID); + _ser.putc(' '); + sendInt(font); + _ser.putc('\r'); + waitForCR(); +} + void ezLCD3::font( char *str) { sendInt(Font);