04.03.2013 Views

Basic Micro Studio Syntax Manual

Basic Micro Studio Syntax Manual

Basic Micro Studio Syntax Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

SOUND<br />

<strong>Syntax</strong><br />

sound pin, [duration\note, ...]<br />

• Pin - is a variable or constant that specifi es the pin used to generate the sounds on.<br />

Commands<br />

• Duration - is a variable, constant or expression that specifi es how long to play the note following<br />

the backslash (\). Duration is in milliseconds.<br />

• Note - is a variable constant or expression that specifi es the frequency to generate in Hz. Notes<br />

and their duration can be a list separated by commas and only limited to the amount of user ram<br />

available.<br />

Supported<br />

• BA - Supported<br />

• BAN - Supported<br />

• BAP - Supported<br />

• BAP40 - Supported<br />

Description<br />

The SOUND command generates a square wave output. It can drive a small piezo speaker without<br />

amplifi cation. To increase the volume output add a low pass fi lter such as a 10uf capacitor in-line.<br />

Schematic<br />

The schematic outlines a simple method of connecting a piezo speaker. The 10uf capacitor is typically<br />

an electrolytic but can be a tantalum. You can experiment by omitting the capacitor when a song is<br />

being played to see the difference it makes.<br />

P0<br />

C1<br />

10uF<br />

C2<br />

10uF<br />

SPK1<br />

+<br />

-<br />

Speaker<br />

195

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!