From 6097152486b226f5e28229166b5f813d979e0413 Mon Sep 17 00:00:00 2001 From: trekhopton Date: Fri, 19 Apr 2024 17:21:05 +0930 Subject: [PATCH] cmd/treatment: decode volume string to base 10 int Previously it was decoded to hex but the i2c method expects a base 10 int --- cmd/treatment/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/treatment/main.go b/cmd/treatment/main.go index 7baa380f..845247a6 100644 --- a/cmd/treatment/main.go +++ b/cmd/treatment/main.go @@ -328,7 +328,7 @@ func setChannels(mode string, l logging.Logger) error { // setVolume sends i2c commands to the amplifier in order to set the volume of the amplifier. func setVolume(hexVol string, bus embd.I2CBus) error { - vol, err := strconv.ParseInt(hexVol, 16, 8) + vol, err := strconv.ParseInt(hexVol, 10, 8) if err != nil { return fmt.Errorf("could not parse hex volume: %w", err) }