diff --git a/README.md b/README.md index c93a8de..a4f5683 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,12 @@ print(df.get_files_in_folder(4)) - set the volume of the module. - vol: Volume of the module. The range is 0 to 30. The DFPlayer doesn't remember these settings +```volume_up()``` +- increase the volume by 1 up to the maximum of 30. + +```volume_down()``` +- decrease the volume by 1 down to the minimum of 1. + ```get_volume()``` - returns the current volume setting of the module or -1 on communication error diff --git a/src/dfplayer/__init__.py b/src/dfplayer/__init__.py index 5d5c465..0ff6f08 100644 --- a/src/dfplayer/__init__.py +++ b/src/dfplayer/__init__.py @@ -60,6 +60,12 @@ def play(self,folder,file): def volume(self,vol): self.send_cmd(6,0,vol) + + def volume_up(self): + self.send_cmd(4,0,0) + + def volume_down(self): + self.send_cmd(5,0,0) def reset(self): self.send_cmd(12,0,1)