Playing sounds is actually part of the advanced I/O from the Arduino library. It is possible to play music or even sounds (as we stated before, be careful with sounds, as you can easily run out of memory) on your robot.
To do this, you will want to use the tone
and noTone
functions from the Arduino library, which you can find out more about here.
Sound Challenges
- Make your robot play a short tune when it has completed a task. Write a function to do this so the robot can “celebrate” completing a task.