/** Send data to LCD 8 or 4 bits */ void lcd_send(u8 value, u8 mode) { digitalwrite(_rs_pin, mode); if (_displayfunction & LCD_8BITMODE) { lcd_write8bits(value); } else { lcd_write4bits(value >> 4); // Upper 4 bits first lcd_write4bits(value); // Lower 4 bits second } }
// write either command or data, with automatic 4/8-bit selection void lcd_send(uint8_t value, uint8_t mode) { digitalWrite(_rs_pin, mode); // if there is a RW pin indicated, set it low to Write if (_rw_pin != 255) { digitalWrite(_rw_pin, LOW); } if (_displayfunction & LCD_8BITMODE) { lcd_write8bits(value); } else { lcd_write4bits(value>>4); lcd_write4bits(value & 0x0F); } }