DFPlayerMini_Fast icon indicating copy to clipboard operation
DFPlayerMini_Fast copied to clipboard

Octal error when playing from folder 08 or 09

Open ridilen opened this issue 2 years ago • 1 comments

Using file 08 or 09 gives this error

States:50:31: error: invalid digit "8" in octal constant myDFPlayer.playFolder(08, buttonV);

01 - 07 and 10 - 99 work fine.

ridilen avatar Jan 30 '23 02:01 ridilen

Hi, this is a declaration problem. You tell the comiler to use classic decimals by just using numbers without leading values, like 1, 2 or 111. For hexadecimal numbers you start with 0x like 0x01, 0x1a or 0xff or 0x12345678. For octal numbers C / C++ uses a leading zero so 01 is a declaration for the decimal number 1. 08 is not allowed since in the octal notation only the numerals 0 to 7 are allowed. And 010 is also an allowed and valid value but means decimal 8.

In your case you do not need a leading zero because the player itself puts ths zero into the folder and / or file name.

derniwi avatar Jun 21 '23 18:06 derniwi