+ Post New Thread
Results 1 to 4 of 4
  1. #1
    Newbie level 1
    Points: 177, Level: 2

    Join Date
    Jan 2019
    Posts
    1
    Helped
    0 / 0
    Points
    177
    Level
    2

    LCD and DFplayer working simultaneously

    I have separate codes.
    1) for displaying data on 16*2 LCD which is shifting at 0.5 seconds
    2) another code for playing songs on DFplayer (2 minutes song whic plays when I press a button)

    I want to play the song and the text on the LCD to be shifting at the same time.

    How do I do that. bec the code waits till the song is being played by the dfplayer.

    •   AltAdvertisement

        
       

  2. #2
    Advanced Member level 5
    Points: 12,739, Level: 27
    Achievements:
    7 years registered

    Join Date
    Apr 2010
    Posts
    1,935
    Helped
    416 / 416
    Points
    12,739
    Level
    27

    Re: LCD and DFplayer working simultaneously

    you have not included the overall code structure.
    One reason can be that the DFplayer code may contain a wait like routine which returns only after player started.


    1 members found this post helpful.

    •   AltAdvertisement

        
       

  3. #3
    Super Moderator
    Points: 79,217, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    16,080
    Helped
    3642 / 3642
    Points
    79,217
    Level
    68

    Re: LCD and DFplayer working simultaneously

    Hi,

    Use interrupts. That's why they are invented.
    It should be no problem to control the display shift in an ISR.

    There are many tutorials how to use interrupts. I'm sure there are a lot of examples with displays.

    Klaus
    Please don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



    •   AltAdvertisement

        
       

  4. #4
    Member level 3
    Points: 1,214, Level: 7

    Join Date
    Sep 2014
    Location
    bangalore
    Posts
    59
    Helped
    1 / 1
    Points
    1,214
    Level
    7

    Re: LCD and DFplayer working simultaneously

    thanks a lot for the help. I found out that dfplayer works on serial port so one just have to give commands to play an audio and then the main code runs as usual. I need to write the logic to see if the song has finished playing before playing another.



--[[ ]]--