Skip to content

Commit 2ff396e

Browse files
authored
Disambiguate tone function
The program included a tone function which is also an Arduino built-in function so the compiler threw warnings it didn't know which to use. Changed the local function to fhtone to disambiguate as to which function to use and changed parameters to floats per the function spec.
1 parent 5c20ab5 commit 2ff396e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

FunHouse_Arduino_Demos/selftest/selftest.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,10 @@ void loop() {
249249
/************************** Beep! */
250250
if (digitalRead(BUTTON_SELECT)) {
251251
Serial.println("** Beep! ***");
252-
tone(SPEAKER, 988, 100); // tone1 - B5
253-
tone(SPEAKER, 1319, 200); // tone2 - E6
252+
fhtone(SPEAKER, 988.0, 100.0); // tone1 - B5
253+
fhtone(SPEAKER, 1319.0, 200.0); // tone2 - E6
254254
delay(100);
255-
//tone(SPEAKER, 2000, 100);
255+
//fhtone(SPEAKER, 2000.0, 100.0);
256256
}
257257

258258
/************************** LEDs */
@@ -270,7 +270,7 @@ void loop() {
270270
}
271271

272272

273-
void tone(uint8_t pin, float frequency, float duration) {
273+
void fhtone(uint8_t pin, float frequency, float duration) {
274274
ledcSetup(1, frequency, 8);
275275
ledcAttachPin(pin, 1);
276276
ledcWrite(1, 128);

0 commit comments

Comments
 (0)