//------------------------------------------------------------------------------------ //TASK: sends the LCD setup code for 4-bit mode //@param lcdSetup - a reference to an array of setup values //@param setupSize - the length of the setup table //------------------------------------------------------------------------------------ void initLCD(unsigned char lcdSetup[], unsigned char setupSize) { unsigned char i; //assuming poweron right now. wait more than 40ms lcdDelay(); for (i = 0; i < setupSize; i++) writeLcdCtl(lcdSetup[i]); lcdDelay(); }
// LCD Backlight Off void rDK_GLCD::BacklightOFF() { //turns off the backlight SoftwareSerial::write(LCD_COMANDO); // Command 0x7C Set the LCD Display in command mode SoftwareSerial::write(LCD_BACKLIGHT); SoftwareSerial::write(byte(0)); //Switch Off backlight lcdDelay(); }
/* Basada en la documentación de Sparkfun */ void rDK_GLCD::GotoPosition(uint8_t col, uint8_t fila) { SoftwareSerial::write(LCD_COMANDO); SoftwareSerial::write(LCD_COLUMNA); SoftwareSerial::write(col); SoftwareSerial::write(LCD_COMANDO); SoftwareSerial::write(LCD_FILA); SoftwareSerial::write(fila); lcdDelay(); }
//Clear LCD void rDK_GLCD::Clear() { SoftwareSerial::write(LCD_COMANDO); // Modo comando SoftwareSerial::write(byte(LCD_CLEARSCREEN)); // comando clear LCD lcdDelay(); }
//------------------------------------------------------------------------------------ //TASK: sends an enable pulse to the LCD //------------------------------------------------------------------------------------ void enablePulse() { en_lcd = EN_LOW; // enable line low lcdDelay(); // call delay en_lcd = EN_HIGH; // enable high }