Lib for the LCD display on mbed lab Board
Diff: C12832_lcd.cpp
- Revision:
- 1:66dd8afbfd06
- Parent:
- 0:4bbc531be6e2
- Child:
- 2:bdc53502af17
diff -r 4bbc531be6e2 -r 66dd8afbfd06 C12832_lcd.cpp --- a/C12832_lcd.cpp Tue Oct 16 14:05:57 2012 +0000 +++ b/C12832_lcd.cpp Tue Oct 16 17:50:37 2012 +0000 @@ -44,7 +44,7 @@ } -void C12832_LCD::set_orientation(unsigned int o) +/*void C12832_LCD::set_orientation(unsigned int o) { orientation = o; switch (o) { @@ -67,6 +67,8 @@ } } +*/ + void C12832_LCD::invert(unsigned int o) { if(o == 0) wr_cmd(0xA6); @@ -76,10 +78,16 @@ void C12832_LCD::set_contrast(unsigned int o) { + contrast = o; wr_cmd(0x81); // set volume wr_cmd(o & 0x2F); } +unsigned int C12832_LCD::get_contrast(void) +{ + return(contrast); +} + // write command to lcd controller @@ -130,7 +138,7 @@ wr_cmd(0x22); // voltage resistor ratio wr_cmd(0x2F); // power on - wr_cmd(0xA4); // LCD display ram + //wr_cmd(0xA4); // LCD display ram wr_cmd(0x40); // start line = 0 wr_cmd(0xAF); // display ON