From 07cc45d86113533bd47500d6bc8929b06b71b073 Mon Sep 17 00:00:00 2001 From: Neil McKechnie Date: Thu, 16 Sep 2021 12:39:51 +0100 Subject: [PATCH] Update IO_DFPlayer.h Fix volume control command. --- IO_DFPlayer.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/IO_DFPlayer.h b/IO_DFPlayer.h index 4072cae..061cd3f 100644 --- a/IO_DFPlayer.h +++ b/IO_DFPlayer.h @@ -126,7 +126,7 @@ protected: // If value is zero, it stops playing. // WriteAnalogue on second pin sets the output volume. void _writeAnalogue(VPIN vpin, int value, uint8_t, uint16_t) override { - uint8_t pin = _firstVpin - vpin; + uint8_t pin = vpin - _firstVpin; switch (pin) { case 0: if (value > 0) { @@ -159,13 +159,12 @@ protected: } } - bool _isBusy(VPIN vpin) override { - (void)vpin; // avoid compiler warning. + bool _isBusy(VPIN) override { return _playing; } void _display() override { - DIAG(F("DFPlayer Configured on Vpins:%d-%d")); + DIAG(F("DFPlayer Configured on Vpins:%d-%d"), _firstVpin, _firstVpin+_nPins-1); } private: