Documentation ¶
Index ¶
Constants ¶
View Source
const ( // commands LCD_CLEARDISPLAY = 0x01 LCD_RETURNHOME = 0x02 LCD_ENTRYMODESET = 0x04 LCD_DISPLAYCONTROL = 0x08 LCD_CURSORSHIFT = 0x10 LCD_FUNCTIONSET = 0x20 LCD_SETCGRAMADDR = 0x40 LCD_SETDDRAMADDR = 0x80 // flags for display entry mode LCD_ENTRYRIGHT = 0x00 LCD_ENTRYLEFT = 0x02 LCD_ENTRYSHIFTINCREMENT = 0x01 LCD_ENTRYSHIFTDECREMENT = 0x00 // flags for display on/off control LCD_DISPLAYON = 0x04 LCD_DISPLAYOFF = 0x00 LCD_CURSORON = 0x02 LCD_CURSOROFF = 0x00 LCD_BLINKON = 0x01 LCD_BLINKOFF = 0x00 // flags for display/cursor shift LCD_DISPLAYMOVE = 0x08 LCD_CURSORMOVE = 0x00 LCD_MOVERIGHT = 0x04 LCD_MOVELEFT = 0x00 // flags for function set LCD_8BITMODE = 0x10 LCD_4BITMODE = 0x00 LCD_2LINE = 0x08 LCD_1LINE = 0x00 LCD_5x10DOTS = 0x04 LCD_5x8DOTS = 0x00 // flags for backlight control LCD_BACKLIGHT = 0x08 LCD_NOBACKLIGHT = 0x00 En = 0b00000100 // Enable bit Rw = 0b00000010 // Read/Write bit Rs = 0b00000001 // Register select bit )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LCM1602LCD ¶
type LCM1602LCD struct {
// contains filtered or unexported fields
}
LCM1602LCD encapsulates communication with an LCD i2c panel
func NewLCM1602LCD ¶
func NewLCM1602LCD(i2c *i2c.Device) (*LCM1602LCD, error)
NewLCM1602LCD instantiates a new LCM1602LCD for the address provided
func (*LCM1602LCD) WritePaddedString ¶ added in v0.0.2
func (l *LCM1602LCD) WritePaddedString(message string, row int, startPosition byte) error
WritePaddedString writes a string to the LCD at the given row, but pads the row to effectively wipe any remaining characters off the line. This is handy for when you want to repeatedly display data on a line, but it could be of varying length, and you don't want to blank the entire screen each time.
func (*LCM1602LCD) WriteString ¶
func (l *LCM1602LCD) WriteString(message string, row int, startPosition byte) error
WriteString writes a string to the LCD at the given row
Click to show internal directories.
Click to hide internal directories.