Problems
- only when I write map(sensorReading, 0, 900, 100, 1000), my speaker works; if writing map(sensorReading, 200, 900, 100, 1000), it doesnt work.

- Dont really understand: If the tone is playing on the same pin, the call will set its frequency.
- My instrument can’t work
Tone Output Using An Arduino
- If a speaker connects to an output pin runningÂ
analogWrite()
, then getting a changing loudness, but a constant tone. To change the tone, the frequency need to be changed.
- tone()
- ToneMelody