feat(brake): display brake power with 4 colors

This commit is contained in:
2023-05-11 20:02:19 +02:00
parent 8b67d8a434
commit f4f83af3c5
3 changed files with 22 additions and 5 deletions

View File

@@ -21,6 +21,7 @@ func init() {
var (
ColorBlack = Color{0, 0, 0}
ColorRed = Color{255, 0, 0}
ColorPurple = Color{255, 0, 255}
ColorYellow = Color{255, 255, 0}
ColorGreen = Color{0, 255, 0}
ColorBlue = Color{0, 0, 255}
@@ -145,6 +146,7 @@ func (l *PiColorLed) blink(freq float64) {
var setLed = func(v int, led gpio.PinIO, mutex *sync.Mutex) {
mutex.Lock()
defer mutex.Unlock()
lvl := gpio.High
if v == 0 {
lvl = gpio.Low