Skip to content

Commit d751d0b

Browse files
authored
Update tonePitchFollower.ino
1 parent 569885b commit d751d0b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/02.Digital/tonePitchFollower/tonePitchFollower.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
https://www.arduino.cc/en/Tutorial/BuiltInExamples/tonePitchFollower
1818
*/
1919

20+
int buzzerPin = 9;
21+
2022
void setup() {
2123
// initialize serial communications (for debugging only):
2224
Serial.begin(9600);
@@ -34,6 +36,6 @@ void loop() {
3436
int thisPitch = map(sensorReading, 400, 1000, 120, 1500);
3537

3638
// play the pitch:
37-
tone(9, thisPitch, 10);
39+
tone(buzzerPin, thisPitch, 10);
3840
delay(1); // delay in between reads for stability
3941
}

0 commit comments

Comments
 (0)