Buzzer Control#

Sample API functions for playing tunes on a piezo buzzer.

See buzzer.h for source code.

Note Definitions#

Flats are used instead of sharps because # is a special character.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

#define

A note which can be used in tune structure definitions.

Functions#

void
halPlayTune_P(uint8_t PGM *tune, bool bkg)

Plays a tune on the piezo buzzer.

void

Causes something to happen on a node (such as playing a tune on the buzzer) that can be used to indicate where it physically is.

Note Definitions Documentation#

NOTE_C3#

#define NOTE_C3
Value:
119

A note which can be used in tune structure definitions.


Definition at line 32 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_Db3#

#define NOTE_Db3
Value:
112

A note which can be used in tune structure definitions.


Definition at line 33 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_D3#

#define NOTE_D3
Value:
106

A note which can be used in tune structure definitions.


Definition at line 34 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_Eb3#

#define NOTE_Eb3
Value:
100

A note which can be used in tune structure definitions.


Definition at line 35 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_E3#

#define NOTE_E3
Value:
94

A note which can be used in tune structure definitions.


Definition at line 36 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_F3#

#define NOTE_F3
Value:
89

A note which can be used in tune structure definitions.


Definition at line 37 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_Gb3#

#define NOTE_Gb3
Value:
84

A note which can be used in tune structure definitions.


Definition at line 38 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_G3#

#define NOTE_G3
Value:
79

A note which can be used in tune structure definitions.


Definition at line 39 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_Ab3#

#define NOTE_Ab3
Value:
74

A note which can be used in tune structure definitions.


Definition at line 40 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_A3#

#define NOTE_A3
Value:
70

A note which can be used in tune structure definitions.


Definition at line 41 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_Bb3#

#define NOTE_Bb3
Value:
66

A note which can be used in tune structure definitions.


Definition at line 42 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_B3#

#define NOTE_B3
Value:
63

A note which can be used in tune structure definitions.


Definition at line 43 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_C4#

#define NOTE_C4
Value:
59

A note which can be used in tune structure definitions.


Definition at line 44 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_Db4#

#define NOTE_Db4
Value:
55

A note which can be used in tune structure definitions.


Definition at line 45 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_D4#

#define NOTE_D4
Value:
52

A note which can be used in tune structure definitions.


Definition at line 46 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_Eb4#

#define NOTE_Eb4
Value:
49

A note which can be used in tune structure definitions.


Definition at line 47 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_E4#

#define NOTE_E4
Value:
46

A note which can be used in tune structure definitions.


Definition at line 48 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_F4#

#define NOTE_F4
Value:
44

A note which can be used in tune structure definitions.


Definition at line 49 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_Gb4#

#define NOTE_Gb4
Value:
41

A note which can be used in tune structure definitions.


Definition at line 50 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_G4#

#define NOTE_G4
Value:
39

A note which can be used in tune structure definitions.


Definition at line 51 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_Ab4#

#define NOTE_Ab4
Value:
37

A note which can be used in tune structure definitions.


Definition at line 52 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_A4#

#define NOTE_A4
Value:
35

A note which can be used in tune structure definitions.


Definition at line 53 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_Bb4#

#define NOTE_Bb4
Value:
33

A note which can be used in tune structure definitions.


Definition at line 54 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_B4#

#define NOTE_B4
Value:
31

A note which can be used in tune structure definitions.


Definition at line 55 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_C5#

#define NOTE_C5
Value:
29

A note which can be used in tune structure definitions.


Definition at line 56 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_Db5#

#define NOTE_Db5
Value:
27

A note which can be used in tune structure definitions.


Definition at line 57 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_D5#

#define NOTE_D5
Value:
26

A note which can be used in tune structure definitions.


Definition at line 58 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_Eb5#

#define NOTE_Eb5
Value:
24

A note which can be used in tune structure definitions.


Definition at line 59 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_E5#

#define NOTE_E5
Value:
23

A note which can be used in tune structure definitions.


Definition at line 60 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_F5#

#define NOTE_F5
Value:
21

A note which can be used in tune structure definitions.


Definition at line 61 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_Gb5#

#define NOTE_Gb5
Value:
20

A note which can be used in tune structure definitions.


Definition at line 62 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_G5#

#define NOTE_G5
Value:
19

A note which can be used in tune structure definitions.


Definition at line 63 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_Ab5#

#define NOTE_Ab5
Value:
18

A note which can be used in tune structure definitions.


Definition at line 64 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_A5#

#define NOTE_A5
Value:
17

A note which can be used in tune structure definitions.


Definition at line 65 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_Bb5#

#define NOTE_Bb5
Value:
16

A note which can be used in tune structure definitions.


Definition at line 66 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

NOTE_B5#

#define NOTE_B5
Value:
15

A note which can be used in tune structure definitions.


Definition at line 67 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

Function Documentation#

halPlayTune_P#

void halPlayTune_P (uint8_t PGM * tune, bool bkg)

Plays a tune on the piezo buzzer.

Parameters
N/Atune

A pointer to tune to play.

N/Abkg

Determines whether the tune plays in the background. If true, tune plays in background; if false, tune plays in foreground.

The tune is played in the background if ::bkg is true. Otherwise, the API blocks until the playback of the tune is complete. halPlayTune_P() is not meant to be called back-to-back.

A tune is implemented as follows:

uint8_t PGM hereIamTune[] = {  //All tunes are stored in flash.
   NOTE_B4,  1,                //Plays the note B4 for 100 milliseconds.
   0,        1,                //Pause for 100 milliseconds.
   NOTE_B5,  5,                //Plays the note B5 for 500 milliseconds.
   0,        0                 //NULL terminates the tune.
 };

Definition at line 92 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h

halStackIndicatePresence#

void halStackIndicatePresence (void )

Causes something to happen on a node (such as playing a tune on the buzzer) that can be used to indicate where it physically is.

Parameters
N/A

Definition at line 98 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/plugin/buzzer/buzzer.h