http://www.pololu.com/docs/0J17/5.b -- This library allows you to easily control the piezo buzzer on the 3pi robot, Orangutan SV-xx8, and Orangutan LV-168. It gives you the option of playing either a note or a frequency for a specified duration at a specified volume, or you can use the play() method to play an entire melody in the background. Buzzer control is achieved using one of the Timer1 PWM outputs, and duration timing is performed using a Timer1 overflow interrupt, so this library will conflict with any other libraries that rely on or reconfigure Timer1. For example, the Arduino function analogWrite() will not work on the Timer1 PWM output pins once you have started to use this library in your sketch. The benefit to this approach is that you can play notes on the buzzer while leaving the CPU mostly free to execute the rest of your code. This means you can have a melody playing in the background while your Orangutan or 3pi does its main task. You can poll the isPlaying() method to determine when the buzzer is finished playing. You do not need to initialize your OrangutanBuzzer object before use. All initialization is performed automatically when needed. All of the methods in this class are static; you should never have more than one instance of an OrangutanBuzzer object in your sketch.
Share this library with your friends on your favorite profile: