Buzzer

Functions for controlling the buzzer. Functions for controlling the buzzer. Include buzzer.h to access these functions. More...

Defines

#define C4   260
 Middle C.
#define C4s   277
 C#.
#define D4   294
 D.
#define D4s   311
 D#.
#define E4   330
 E.
#define F4   349
 F.
#define F4s   370
 F#.
#define G4   392
 G.
#define G4s   415
 G#.
#define A4   440
 A.
#define A4s   466
 A#.
#define B4   494
 B.
#define C5   523
 C.

Functions

void buzzer_init (void)
 Initialize the buzzer.
void buzzer_set_val (unsigned int buzz_value)
 Set the value the buzzer plays.
void buzzer_set_freq (unsigned int buzz_freq)
 Set the frequency the buzzer plays.
void buzzer_chirp (unsigned int ms, unsigned int buzz_freq)
 Play a frequency for a specified time.
void buzzer_off (void)
 Turn the buzzer off.

Detailed Description

Functions for controlling the buzzer. Functions for controlling the buzzer. Include buzzer.h to access these functions.


Function Documentation

void buzzer_chirp ( unsigned int  ms,
unsigned int  buzz_freq 
)

Play a frequency for a specified time.

Plays the specified frequency for the specified amount of time. This function blocks execution until the time is completed. buzzer_init must be called before this function can be used.

Parameters:
ms the time in milliseconds to play the frequency
buzz_freq the frequency to play
See also:
buzzer_init, buzzer_set_freq

void buzzer_init ( void   ) 

Initialize the buzzer.

Initializes the buzzer. Must be called before any other buzzer function may be used.

void buzzer_off (  ) 

Turn the buzzer off.

Turns off the buzzer by disabling the timer0 clock.

See also:
buzzer_init

void buzzer_set_freq ( unsigned int  buzz_freq  ) 

Set the frequency the buzzer plays.

Sets the buzzer frequency. Usage of constants such as C4 is highly recommended as input to this function. buzzer_init must be called before this function may be used.

Parameters:
buzz_freq the frequency to set the buzzer to
See also:
buzzer_init, buzzer_set_val, buzzer_off

void buzzer_set_val ( unsigned int  buzz_value  ) 

Set the value the buzzer plays.

Sets the value of the buzzer's pitch. Higher values are lower frequencies.

Parameters:
buzz_value the value to set the buzzer's frequency too, in the range 0-255
See also:
buzzer_init, buzzer_set_freq, buzzer_off


Generated on Mon Sep 22 22:30:16 2008 for libdragonfly by  doxygen 1.5.4