Non-blocking sound functionalities


#1

Hi,

I am trying to continuously read sensor values and play sound at the same time.
At this moment, I have the buzzer.tone function playing sound for some time, yet in the sound duration, the process is block, unable to read the sensor.

Anyone can help?

Thanks a lot


#2

Hi,

Check out this link for a discussion on the topic. I wrote an ActionTimer 'library" for Arduino that you can get at this link. It includes an example of how to do time slicing. I also wrote a MusicBox object for Arduino that uses the ActionTimer for timeslicing, but it is not compatible with the Makeblock libraries.

Good luck!

Chuck


#3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.