Little cosmetic for serial LCD
Posted: Sun Nov 13, 2011 6:36 pm
Hi,
I had always spurious caracters on my first screen using a self made Sparkfun serial LCD 2x16, mostly when I restarted the LCD config after an Exit.
So I modify the fonction LCDclear() in LCD.pde and it's working well now.
//Modif LCDclear() to avoid spurious caracters on serial LCD Sparkfun
void initLCD() {
blinkLED(20,30,1);
#if defined(LCD_TEXTSTAR)
// Cat's Whisker Technologies 'TextStar' Module CW-LCD-02
// http://cats-whisker.com/resources/docum ... asheet.pdf
// Modified by Luca Brizzi aka gtrick90 @ RCG
LCDprint(0xFE);LCDprint(0x43);LCDprint(0x02); //cursor blink mode
#elif defined(LCD_ETPP)
// Eagle Tree Power Panel - I2C & Daylight Readable LCD
// Contributed by Danal
i2c_ETPP_init();
#else
Serial.end();
//init LCD
PINMODE_LCD; //TX PIN for LCD = Arduino RX PIN (more convenient to connect a servo plug on arduino pro mini)
#endif
LCDclear();
LCDsetLine(1);
LCDprintChar("MultiWii Config ");
delay(2500);
LCDclear();
}
...
void LCDclear() {
#if defined(LCD_ETPP)
i2c_ETPP_send_cmd(0x01); // Clear display command, which does NOT clear an Eagle Tree because character set "R" has a '>' at 0x20
for (byte i = 0; i<80; i++) i2c_ETPP_send_char(' '); // Blanks for all 80 bytes of RAM in the controller, not just the 2x16 display
#elseif defined(LCD_TEXTSTAR)
LCDprint(0x0c); //clear screen
#else
LCDprint(0xFE);LCDprint(0x01);delay(10);LCDprint(0xFE);LCDprint(0x02);delay(10); // clear screen, cursor line 1, pos 0 for serial LCD Sparkfun
#endif
}
OK, it's not so important but it's nice when all works well.
Regards
flyman777
I had always spurious caracters on my first screen using a self made Sparkfun serial LCD 2x16, mostly when I restarted the LCD config after an Exit.
So I modify the fonction LCDclear() in LCD.pde and it's working well now.
//Modif LCDclear() to avoid spurious caracters on serial LCD Sparkfun
void initLCD() {
blinkLED(20,30,1);
#if defined(LCD_TEXTSTAR)
// Cat's Whisker Technologies 'TextStar' Module CW-LCD-02
// http://cats-whisker.com/resources/docum ... asheet.pdf
// Modified by Luca Brizzi aka gtrick90 @ RCG
LCDprint(0xFE);LCDprint(0x43);LCDprint(0x02); //cursor blink mode
#elif defined(LCD_ETPP)
// Eagle Tree Power Panel - I2C & Daylight Readable LCD
// Contributed by Danal
i2c_ETPP_init();
#else
Serial.end();
//init LCD
PINMODE_LCD; //TX PIN for LCD = Arduino RX PIN (more convenient to connect a servo plug on arduino pro mini)
#endif
LCDclear();
LCDsetLine(1);
LCDprintChar("MultiWii Config ");
delay(2500);
LCDclear();
}
...
void LCDclear() {
#if defined(LCD_ETPP)
i2c_ETPP_send_cmd(0x01); // Clear display command, which does NOT clear an Eagle Tree because character set "R" has a '>' at 0x20
for (byte i = 0; i<80; i++) i2c_ETPP_send_char(' '); // Blanks for all 80 bytes of RAM in the controller, not just the 2x16 display
#elseif defined(LCD_TEXTSTAR)
LCDprint(0x0c); //clear screen
#else
LCDprint(0xFE);LCDprint(0x01);delay(10);LCDprint(0xFE);LCDprint(0x02);delay(10); // clear screen, cursor line 1, pos 0 for serial LCD Sparkfun
#endif
}
OK, it's not so important but it's nice when all works well.
Regards
flyman777