#include /**********************************TONE***********************************/ /* Produces tone at frequency, duration (of sound) */ /* Arguments in: freq [in Hz], dur [duration in millisec.] */ /*************************************************************************/ void tone( int freq, int dur ) { sound( freq ); delay( dur ); nosound(); return; } /**************************************************************************/ /* Produces a "two-tone" sound (beep-boop) */ /**************************************************************************/ void two_tone() { int frequency, duration; frequency = 700; duration = 165; tone( frequency, duration ); frequency = 450; duration = 110; tone( frequency, duration ); } /**************************************************************************/ /* BELL */ /* Produces a succession of 'beep' tones */ /* Takes 'times' as argument [# of times to beep] */ /**************************************************************************/ void bell( int times ) { while( times-- ) { tone(380,165); delay (20 ); } return; } /**************************************************************************/ /* BLATT */ /* Produces a "Bronx Cheer" */ /* [use with error routine] */ /**************************************************************************/ void blatt() { tone( 42,330 ); tone(34,220); return; }