From 80913d5fe781a7562b5dddd4ba65c654c1bc4887 Mon Sep 17 00:00:00 2001 From: Drayton Munster Date: Mon, 17 Jan 2022 00:41:16 -0500 Subject: [PATCH] Reset data pins to output mode after reading --- hd44780/gpio.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hd44780/gpio.go b/hd44780/gpio.go index 0549ab7..71376fc 100644 --- a/hd44780/gpio.go +++ b/hd44780/gpio.go @@ -105,7 +105,8 @@ func (g *GPIO) Read(data []byte) (n int, err error) { data[i] = g.read() n++ } - g.reconfigureGPIOMode(machine.PinInput) + g.rw.Low() + g.reconfigureGPIOMode(machine.PinOutput) return n, nil } @@ -113,6 +114,7 @@ func (g *GPIO) read4BitMode() byte { g.en.High() data := (g.pins() << 4 & 0xF0) g.en.Low() + g.en.High() data |= (g.pins() & 0x0F) g.en.Low()