To recap my presentation on Arduino audio and speakers:
-A speaker consists of a magnet and an electromagnet. The electromagnet oscillates polarity based on fluctuations in the voltage values it receives
-Voltage is converted into vibrations within the speaker
- Audio is output via PWM, which results in a Square Wave.
-Shorter delays in a PWM cycle result in a higher frequency (higher pitch) sound.
-The amount of times this PWM cycle is run determines the duration (sustain) of a pitch.
Example Code:
1. Play the star wars theme song using coded tone values
2. Control the pitch and duration of an octave sequence separately with 2 variable resistors.
Based on the "
Freqout" arduino example
3. Play a tonal range with a variable resistor