Project

General

Profile

Statistics
| Revision:

root / branches / encoders / code / lib / include / libdragonfly / buzzer.h @ 546

History | View | Annotate | Download (1.26 KB)

1 7 bcoltin
/**
2
 * @file buzzer.h
3
 * @brief Contains definitions for using the buzzer.
4
 *
5
 * Contains definitions for using the buzzer built into
6
 * the colony robots.
7
 *
8
 * @author Colony Project, CMU Robotics Club
9
 **/
10
11
#ifndef _BUZZER_H_
12
#define _BUZZER_H_
13
14
/**
15
 * @addtogroup buzzer
16
 * @{
17
 **/
18
19
//Musical note definitions
20
//Source: http://www.answers.com/topic/piano-key-frequencies
21
/** @brief Middle C **/
22
#define        C4        260 //Middle C
23
/** @brief C# **/
24
#define        C4s        277 //C sharp
25
/** @brief D **/
26
#define        D4        294
27
/** @brief D# **/
28
#define        D4s        311
29
/** @brief E **/
30
#define        E4        330
31
/** @brief F **/
32
#define        F4        349
33
/** @brief F# **/
34
#define        F4s        370
35
/** @brief G **/
36
#define        G4        392
37
/** @brief G# **/
38
#define        G4s        415
39
/** @brief A **/
40
#define        A4        440
41
/** @brief A# **/
42
#define        A4s        466
43
/** @brief B **/
44
#define        B4        494
45
/** @brief C **/
46
#define        C5        523
47
48
/** @brief Initialize the buzzer. **/
49
void buzzer_init(void);
50
/** @brief Set the value the buzzer plays. **/
51
void buzzer_set_val(unsigned int buzz_value);
52
/** @brief Set the frequency the buzzer plays. **/
53
void buzzer_set_freq(unsigned int buzz_freq);
54
/** @brief Play a frequency for a specified time. **/
55
void buzzer_chirp(unsigned int ms, unsigned int buzz_freq);
56
/** @brief Turn the buzzer off. **/
57
void buzzer_off(void);
58
59
/** @} **/ //end addtogroup
60
61
#endif