Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b92b942

Browse files
Fix typos in docs (#952)
* Fix typo * Fix another typo
1 parent 94c4e6a commit b92b942

File tree

1 file changed

+2
-2
lines changed
  • content/learn/03.programming/10.audio

1 file changed

+2
-2
lines changed

‎content/learn/03.programming/10.audio/audio.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This article highlights different approaches to making sounds and even entire so
1818

1919
The examples are nevertheless still relevant as they explain some basic concepts of generating tone frequencies, interpolation and even provide you with some songs to try out. If you want to see an example for a simple melody using the [tone()](https://www.arduino.cc/reference/en/language/functions/advanced-io/tone/) library and familiarize yourself with the concept of external sound data files, you can check out [this example](https://docs.arduino.cc/built-in-examples/digital/toneMelody).
2020

21-
Most sketches in this article use pin 8 as output for the piezo buzzer or speaker which means you only need to connect your components a shown below and try out the different examples by uploading them to your Arduino. Only the **PCMAudio** example uses pin 11 as it is making us of [PWM](https://www.arduino.cc/en/Tutorial/Foundations/PWM).
21+
Most sketches in this article use pin 8 as output for the piezo buzzer or speaker which means you only need to connect your components a shown below and try out the different examples by uploading them to your Arduino. Only the **PCMAudio** example uses pin 11 as it is making use of [PWM](https://www.arduino.cc/en/Tutorial/Foundations/PWM).
2222

2323
## Hardware Required
2424

@@ -276,7 +276,7 @@ j++; // Increments j by 1.
276276

277277
## PCMAudio
278278

279-
The following example was created by Michael Smith and is the precursor for the [PCM](https://www.arduino.cc/reference/en/libraries/pcm/) library created by David Mellis. It play's 8-bit PCM audio on pin 11 using pulse-width modulation [(PWM)](https://www.arduino.cc/en/Tutorial/Foundations/PWM). It uses two timers. The first changes the sample value 8000 times a second. The second holds pin 11 high for 0-255 ticks out of a 256-tick cycle, depending on the sample value. The second timer repeats 62500 times per second (16000000 / 256), which is much faster than the playback rate (8000 Hz), so it almost sounds halfway decent, just really quiet on a PC speaker.
279+
The following example was created by Michael Smith and is the precursor for the [PCM](https://www.arduino.cc/reference/en/libraries/pcm/) library created by David Mellis. It plays 8-bit PCM audio on pin 11 using pulse-width modulation [(PWM)](https://www.arduino.cc/en/Tutorial/Foundations/PWM). It uses two timers. The first changes the sample value 8000 times a second. The second holds pin 11 high for 0-255 ticks out of a 256-tick cycle, depending on the sample value. The second timer repeats 62500 times per second (16000000 / 256), which is much faster than the playback rate (8000 Hz), so it almost sounds halfway decent, just really quiet on a PC speaker.
280280

281281
Takes over Timer 1 (16-bit) for the 8000 Hz timer. This breaks PWM (analogWrite()) for Arduino pins 9 & 10. It then takes Timer 2 (8-bit) for the pulse width modulation, breaking the PWM for pins 11 & 13.
282282

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /