I got the following code:
package main
// import the require modules
import (
"github.com/mrmorphic/hwio"
"github.com/mrmorphic/hwio/devices/hd44780"
"time"
"fmt"
)
func main() {
// Get the i2c module from the driver. i2c is the canonical name. On the BeagleBone, it can also
// be referred to as i2c2.
m, _ := hwio.GetModule("i2c")
// Assert that it is an I2C module
i2c := m.(hwio.I2CModule)
i2c.Enable()
defer i2c.Disable()
// Get a display device on this i2c bus. You need to provide it a device profile. Two profiles
// are currently implemented, PROFILE_MJKDZ and PROFILE_PCF8574, corresponding to two commonly found
// port extenders used to interface to LCD displays.
display := hd44780.NewHD44780(i2c, 0x3f, hd44780.PROFILE_PCF8574)
// Initialise the display with the size of display you have.
display.Init(16, 2)
// The display may not show anything if the backlight is turned off
display.SetBacklight(true)
// clear the display
display.Clear()
// Set cursor to a specific column and row (both zero based)
display.SetCursor(0, 0) // second line
for {
time.Sleep(1*time.Second)
t := time.Now()
display.SetCursor(0, 1)
fmt.Fprint(display, t.Format("15:04:05 2006"))
}
}
Data is comming to the display, but the backlight only turns on, while the data is written to display. Some milliseconds the display is bright, then it turns off. Then, the second, the code is waiting, display is dark.
I tested my display with arduino code and with python code on raspberry, and i got not this strange behavior. So, what can it be? It must be something in this library wrong for my display.
I got the following code:
Data is comming to the display, but the backlight only turns on, while the data is written to display. Some milliseconds the display is bright, then it turns off. Then, the second, the code is waiting, display is dark.
I tested my display with arduino code and with python code on raspberry, and i got not this strange behavior. So, what can it be? It must be something in this library wrong for my display.