Home Forums Sparkfun MP3 Shield Library Support Forum using two MP3 shieds at the same time

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1690
    Anonymous
    Inactive

    My current project needs me to be able to play sounds via two shields at the same time

    can the library cope?

    cheers

    Mike

    #1691

    Can it be done? YES.

    But at this time this library does not outright support multiple cards.

    I have had discussions about doing this and in an effort toward this. The functions were rolled into the Class as members, as to facilitate multiple instances, in the future. However, many of these members functions need be STATIC due to the use of attachInterrupt’s requirement. And the Arduino’s pseudo Linker is not recognizing indirect referenced pointers correctly. As to allow the members to be none static.

    Additionally the IO pins are defined using macros. With the end goal of making them faster, in the future as the current digitalWrite is quite slow. Consuming most of the realtime actually used.

    Assuming multiple file sources too. HenceĀ  SdFat opening multiple files. SdFat claims this can be done by enabling a define switch. But I have not yet tested it.

    At this time the simplest way to accomplish this is to duplicate the library by another name and rename all the Class and defines to another set of names.

    Or move all defines to be passed to member attributes which are then called in place of the defined macro names. And most importantly don’t use interrupt to refill, rather software timer. So that all the statics can become non-static, so that a second object may be instanced.

     

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.