You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+13-8
Original file line number
Diff line number
Diff line change
@@ -90,17 +90,19 @@ void loop() {
90
90
91
91
## API
92
92
93
-
### bool begin(int pin, int notes[], int n_notes, int tempo, bool loop)
93
+
### bool begin(int pin, const int notes[], int n_notes, int tempo, bool loop = false, bool start = false)
94
94
95
-
- int pin ... the pin number connected to piezo buzzer or a speaker.
95
+
-`int pin` ... the pin number connected to piezo buzzer or a speaker.
96
96
97
-
- int notes[] ... An array of note that is a pair of pitch frequency and duration.
97
+
-`const int notes[]` ... An array of musical notes made up of flat pairs of frequency and duration. (same format as in [arduino-songs](https://github.com/robsoncouto/arduino-songs"robsoncouto/arduino-songs") by [Robson Couto](https://github.com/robsoncouto"robsoncouto (Robson Couto)"))
98
98
99
-
- int n_notes ... Number of notes in the array. This is half the number of elements in the array.
99
+
-`int n_notes` ... Number of notes in the array. This is half the number of elements in the array.
100
100
101
-
- int tempo ... The metronome number. For example, `60` means **60 quarter-note beats per minute**.
101
+
-`int tempo` ... The metronome number. For example, `60` means **60 quarter-note beats per minute**.
102
102
103
-
- bool loop ... If `true`, play repeatedly.
103
+
-`bool loop` ... When `true`, play repeatedly.
104
+
105
+
-`bool start` ... When `true`, play immediately.
104
106
105
107
### bool start(void)
106
108
Start playing after calling the "begin" method.
@@ -111,7 +113,7 @@ Stop playing.
111
113
### void end(void)
112
114
Calling this method followed by `stop()` will release the timer resource.
113
115
114
-
### void set_duration_function(int (*calc_duration_function)(int wholenote, int duration))
0 commit comments