Skip to content

Commit

Permalink
Update jhd1313m1 Scroll and grove lcd example
Browse files Browse the repository at this point in the history
  • Loading branch information
zankich committed Jul 16, 2015
1 parent a8fa365 commit 88f7a68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions examples/edison_grove_lcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ func main() {
screen.Home()
screen.SetRGB(0, 255, 0)
screen.Write("goodbye\nhave a nice day")
gobot.Every(500*time.Millisecond, func() {
screen.Scroll(false)
})
})

screen.Home()
Expand Down
4 changes: 2 additions & 2 deletions platforms/i2c/jhd1313m1_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ func (h *JHD1313M1Driver) SetPosition(pos int) (err error) {

func (h *JHD1313M1Driver) Scroll(leftToRight bool) error {
if leftToRight {
return h.connection.I2cWrite(h.rgbAddress, []byte{LCD_CMD, LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVELEFT})
return h.connection.I2cWrite(h.lcdAddress, []byte{LCD_CMD, LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVELEFT})
}

return h.connection.I2cWrite(h.rgbAddress, []byte{LCD_CMD, LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVERIGHT})
return h.connection.I2cWrite(h.lcdAddress, []byte{LCD_CMD, LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVERIGHT})
}

// Halt is a noop function.
Expand Down

0 comments on commit 88f7a68

Please sign in to comment.