Table of Contents
This example uses a 64 ohm speaker connected directly to the AnalogOut pin of mbed. An 8 ohm speaker has toolow impedance for mbed to drive directly.
The parts used in this case is :
|Speaker '-'||mbed Gnd|
|Speaker '+'||mbed p18|
The first example here makes a 5kHz square wave using a DigitalOut
This is only driving the speaker with a digital signal, '0' or '1'.
Now we can use the [[/handbook/AnalogOut|AnalogOut] function on p18, to make a Saw Tooth wave on the speaker.