|
|
|
@ -12,8 +12,6 @@ import (
|
|
|
|
"io"
|
|
|
|
"io"
|
|
|
|
"sync"
|
|
|
|
"sync"
|
|
|
|
|
|
|
|
|
|
|
|
// "time"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"periph.io/x/conn/v3"
|
|
|
|
"periph.io/x/conn/v3"
|
|
|
|
"periph.io/x/conn/v3/display"
|
|
|
|
"periph.io/x/conn/v3/display"
|
|
|
|
"periph.io/x/conn/v3/gpio"
|
|
|
|
"periph.io/x/conn/v3/gpio"
|
|
|
|
@ -40,11 +38,12 @@ type LK2047T struct {
|
|
|
|
// units with LEDS, the pins are used to manipulate them. For the Adafruit
|
|
|
|
// units with LEDS, the pins are used to manipulate them. For the Adafruit
|
|
|
|
// USB/LCD backpack, 4 pins are exposed.
|
|
|
|
// USB/LCD backpack, 4 pins are exposed.
|
|
|
|
Pins []gpio.PinOut
|
|
|
|
Pins []gpio.PinOut
|
|
|
|
d conn.Conn
|
|
|
|
|
|
|
|
writer io.Writer
|
|
|
|
|
|
|
|
mu sync.Mutex
|
|
|
|
|
|
|
|
rows int
|
|
|
|
rows int
|
|
|
|
cols int
|
|
|
|
cols int
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mu sync.Mutex
|
|
|
|
|
|
|
|
d conn.Conn
|
|
|
|
|
|
|
|
writer io.Writer
|
|
|
|
chKeyboard chan byte
|
|
|
|
chKeyboard chan byte
|
|
|
|
shutdown chan struct{}
|
|
|
|
shutdown chan struct{}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -336,8 +335,7 @@ func (dev *LK2047T) LED(number int, color LEDColor) error {
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
err = dev.Pins[number*2+1].Out(gpio.Level(color&Green == Green))
|
|
|
|
return dev.Pins[number*2+1].Out(gpio.Level(color&Green == Green))
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (dev *LK2047T) String() string {
|
|
|
|
func (dev *LK2047T) String() string {
|
|
|
|
|