Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update toneKeyboard.ino
  • Loading branch information
krekr authored Jun 22, 2023
commit 569885ba613109337ed2952f4387714a04516fdf
4 changes: 3 additions & 1 deletion examples/02.Digital/toneKeyboard/toneKeyboard.ino
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

#include "pitches.h"

int buzzerPin = 8;

const int threshold = 10; // minimum reading of the sensors that generates a note

// notes to play, corresponding to the 3 sensors:
Expand All @@ -37,7 +39,7 @@ void loop() {
// if the sensor is pressed hard enough:
if (sensorReading > threshold) {
// play the note corresponding to this sensor:
tone(8, notes[thisSensor], 20);
tone(buzzerPin, notes[thisSensor], 20);
}
}
}