cmd/treatment: decode volume string to base 10 int

Previously it was decoded to hex but the i2c method expects a base 10 int
This commit is contained in:
trekhopton 2024-04-19 17:21:05 +09:30
parent b318bbea7e
commit 6097152486
1 changed files with 1 additions and 1 deletions

View File

@ -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)
}