JAL Library for the DFPlayer Mini audio playback device

21 views
Skip to first unread message

rob...@hotmail.com

unread,
Sep 18, 2020, 1:22:00 PM9/18/20
to jallist
Hello all,

I created a JAL library that supports the control of the DFPlayer Mini audio playback device. Two sample files are provided that show how to use the library. It will be available in the next bee-package.

A draft version of the library was distributed some time ago and already demonstrated. For more information see the blog post: http://www.justanotherlanguage.org:3389/node/325 

If you encounter any issues with the library let me know.

Kind regards,

Rob

FraserSmith51

unread,
May 17, 2022, 12:25:24 PMMay 17
to jallist
Hi Rob

I have been very slow getting into using this library but am making progress now. I have been able to select files from folders and play them quite happily but now want to be able to use random files with random delays between them. To do that I could monitor the busy pin but using the serial output from the player seemed more sensible.  I have a statement in my code

   if dfplayer_sw3_is_stopped() then

that I thought would do the job but I get an error from the compiler

[Error] (dfplayer_sw3.jal) [Line 758]  _dfplayer_sw3_query declared but not defined  (The sw3 bit is that I have four DFPlayers 0-3 that give me thunder, rain, train and city sounds so I needed four versions of the serial software)

Line 758 is the 6th line in the function definition

function dfplayer_sw3_is_stopped() return bit is

   var word status
   var bit ok

    if _dfplayer_sw3_query(_DFPLAYER_sw3_GET_STATUS, 0, status) then
       ok = (status == 0x0000)
    else
       ok = FALSE
    end if

    return ok
 
end function
I have downloaded the current DFPlayer.jal to check but I don't see a  _dfplayer_queryfunction in that either.

I've looked at the library but I'm stumped as to what is needed here.

Thanks

Fraser

Rob CJ

unread,
May 17, 2022, 12:36:10 PMMay 17
to jal...@googlegroups.com
Hi Fraser,

I did not add a function called _dfplayer_sw3_query that I know for sure.

Can you send me the file that you modified and the main program?

Thanks.

Kind regards,

Rob




Van: jal...@googlegroups.com <jal...@googlegroups.com> namens FraserSmith51 <fra...@cairntoul.net>
Verzonden: dinsdag 17 mei 2022 18:25
Aan: jallist <jal...@googlegroups.com>
Onderwerp: [jallist] Re: JAL Library for the DFPlayer Mini audio playback device
 
--
You received this message because you are subscribed to the Google Groups "jallist" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jallist+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jallist/439b3eee-f4a6-483a-b712-f5eb2bdced01n%40googlegroups.com.

FraserSmith51

unread,
May 17, 2022, 1:35:56 PMMay 17
to jallist
Hi Rob

Here is the complete collection of files that I am using (I hope). It's not very pretty as it's a work in progress where I am having to work out how to do things as I go.

You will see that at line 318 in both mine and your version that you have declared the function that contains query. In the block of functions that are called to retreive data from the player from lines 719 to 945 in your original (718 to 944 in my version) this _dfplayer_query function is referred to.

HTH

Fraser
Ambience_Controller.zip

FraserSmith51

unread,
May 17, 2022, 3:15:22 PMMay 17
to jallist
Hi Rob

I think I have found the problem. I appear to have lost the end of the include file where the _dfplayer_query function is defined. Just rebuilding the four files to test if that was the problem.
Apologies for my stupid mistake and thanks for your time in looking at this.
Fraser

Rob CJ

unread,
May 18, 2022, 12:40:41 PMMay 18
to jal...@googlegroups.com
Hi Fraser,

Always nice to see problems being solved. Thanks for the update.

Kind regards,

Rob


Verzonden: dinsdag 17 mei 2022 21:15
Aan: jallist <jal...@googlegroups.com>
Onderwerp: Re: [jallist] Re: JAL Library for the DFPlayer Mini audio playback device
 
Reply all
Reply to author
Forward
0 new messages