mirror of https://bitbucket.org/ausocean/av.git
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:
parent
b318bbea7e
commit
6097152486
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue