@@ -38,30 +38,30 @@ void setup()
38
38
display.display (); // Put clear image on display
39
39
40
40
// Init the buzzer, this must be called if using it
41
- display.buzzer . begin ();
41
+ display.initBuzzer ();
42
42
43
43
// The most basic example
44
44
// This will produce three short beeps
45
45
// The beeps are each 80ms long
46
- display.buzzer . beep (80 );
46
+ display.beep (80 );
47
47
delay (80 );
48
- display.buzzer . beep (80 );
48
+ display.beep (80 );
49
49
delay (80 );
50
- display.buzzer . beep (80 );
50
+ display.beep (80 );
51
51
delay (80 );
52
52
53
53
delay (5000 ); // Wait 5 seconds before the next example
54
54
55
55
// The buzzer may also be controlled by manually turning it on or off
56
56
// beepOn will turn on the buzzer indefinitely until beepOff is called
57
57
// This will produce two 200 ms beeps
58
- display.buzzer . beepOn ();
58
+ display.beepOn ();
59
59
delay (200 );
60
- display.buzzer . beepOff ();
60
+ display.beepOff ();
61
61
delay (200 );
62
- display.buzzer . beepOn ();
62
+ display.beepOn ();
63
63
delay (200 );
64
- display.buzzer . beepOff ();
64
+ display.beepOff ();
65
65
delay (200 );
66
66
67
67
delay (5000 ); // Wait 5 seconds before the next example
@@ -70,13 +70,13 @@ void setup()
70
70
// Note that pitch is approximated as the digital potentiometer does not affect the pitch in a linear way
71
71
// Frequencies from 572 to 2933 Hz are supported
72
72
// Here are two low pitched (~750Hz) followed by two high pitched (~2400Hz) beeps
73
- display.buzzer . beep (300 , 750 );
73
+ display.beep (300 , 750 );
74
74
delay (50 );
75
- display.buzzer . beep (300 , 750 );
75
+ display.beep (300 , 750 );
76
76
delay (50 );
77
- display.buzzer . beep (300 , 2400 );
77
+ display.beep (300 , 2400 );
78
78
delay (50 );
79
- display.buzzer . beep (300 , 2400 );
79
+ display.beep (300 , 2400 );
80
80
delay (50 );
81
81
82
82
delay (5000 ); // Wait 5 seconds before the next example
@@ -89,16 +89,16 @@ void loop()
89
89
if (repeatCounter < 2 )
90
90
{
91
91
// Play the note set to be played for 100 ms
92
- display.buzzer . beep (100 , chord[currentNoteIndex]);
92
+ display.beep (100 , chord[currentNoteIndex]);
93
93
delay (600 ); // Wait 600 ms so there's room between the notes
94
94
}
95
95
// The second four times play the notes twice
96
96
else
97
97
{
98
98
// Play the note set to be played for 100 ms
99
- display.buzzer . beep (100 , chord[currentNoteIndex]);
99
+ display.beep (100 , chord[currentNoteIndex]);
100
100
delay (250 ); // Wait 300 ms and play it again for 50 ms
101
- display.buzzer . beep (50 , chord[currentNoteIndex]);
101
+ display.beep (50 , chord[currentNoteIndex]);
102
102
delay (300 ); // Wait for 300 ms, this totals to 700 so it's in rhythm
103
103
}
104
104
0 commit comments