// Sets the cursor to the given position // line 1: 0-15, line 2: 16-31, 31+ defaults back to 0 void Lamp::goTo(int position) { if (position < 16) { serCommand(); //command flag Serial1.write((position+128)); } else if (position < 32) { serCommand(); //command flag Serial1.write((position+48+128)); } else { goTo(0); } }
void LCD_Display::position(int row, int col) { serCommand(); //command flag _LCD->write(0x80); // set cursor position command if (row == 2) col = col + 16; _LCD->write(col); //LCD.write((col + row*64 + 128)); //position delay(LCDdelay); }
// Resets the display void SerialLCD::clear() { serCommand(); print(0x01, BYTE); }
void SerialLCD::sleft() { serCommand(); print(0x18, BYTE); }
void SerialLCD::sright() { serCommand(); print(0x1C, BYTE); }
void SerialLCD::nounderline() { serCommand(); print(0x0C, BYTE); }
void SerialLCD::noblink() { serCommand(); print(0x0C, BYTE); }
void SerialLCD::blink() { serCommand(); print(0x0D, BYTE); }
void SerialLCD::goToLineTwo() { //puts the cursor at line 0 char 0. serCommand(); //command flag print(192, BYTE); //position }
void Lamp::hideCursor() { serCommand(); Serial1.write(0x0C); }
void Lamp::showCursor() { serCommand(); Serial1.write(0x0E); }
// Resets the display, undoing any scroll and removing all text void Lamp::clearLCD() { serCommand(); Serial1.write(0x01); }
// Starts the cursor at the beginning of the second line (convienence method for goTo(16)) void Lamp::selectLineTwo() { //puts the cursor at line 0 char 0. serCommand(); //command flag Serial1.write(192); //position }
void LCD_Display::shiftLeft() { serCommand(); _LCD->write(0x18); delay(LCDdelay); }
void LCD_Display::shiftRight() { serCommand(); _LCD->write(0x1c); delay(LCDdelay); }
void LCD_Display::clear() { serCommand(); //command flag _LCD->write(0x01); //clear command. delay(LCDdelay); }