MicroMusicWithRtttl

MicroMusicWithRtttl - ' What's a Microcontroller -...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
' What's a Microcontroller - MicroMusicWithRtttl.bs2 ' Play Nokia RTTTL format ringtones using DATA. ' '{$STAMP BS2} '{$PBASIC 2.5} ' ' -----[ I/O Definitions ]------------------------------------------------- ' SpeakerPin CON 9 ' Piezospeaker connected to P9. ' -----[ Variables ]------------------------------------------------------- ' counter VAR Word ' General purpose counter. char VAR Byte ' Variable stores characters. index VAR Word ' Index for pointing at data. noteLetter VAR Byte ' Stores note character. noteFreq VAR Word ' Stores note frequency. noteOctave VAR Word ' Stores note octave. duration VAR Word ' Stores note duration. tempo VAR Word ' Stores tempo. default_d VAR Byte ' Stores default duration. default_o VAR Byte ' Stores default octave. default_b VAR Word ' Stores default beats/min. ' -----[ EEPROM Data ]----------------------------------------------------- ' RTTTL_File DATA "MARIO:d=4,o=5,b=100:16e6,16e6,32p,8e6,16c6,8e6,8g6,8p,8g,8p,8c6,16p,8g,16p,8e,16p, 8a,8b,16a#,8a,16g.,16e6,16g6,8a6,16f6,8g6,8e6,16c6,16d6,8b,16p,8c6,16p,8g,16p,8e,16 p,8a,8b,16a#,8a,16g.,16e6,16g6,8a6,16f6,8g6,8e6,16c6,16d6,8b,8p,16g6,16f#6,16f6,16d #6,16p,16e6,16p,16g#,16a,16c6,16p,16a,16c6,16d6,8p,16g6,16f#6,16f6,16d#6,16p,16e6,1 6p,16c7,16p,16c7,16c7,p,16g6,16f#6,16f6,16d#6,16p,16e6,16p,16g#,16a,16c6,16p,16a,16 c6,16d6,8p,16d#6,8p,16d6,8p,16c6." c Done DATA ",q," Notes DATA "p", "a", "#", "b", "c", "#", "d", "#", "e", "f", "#", "g", "#" Octave8 DATA Word 0, Word 3520, Word 3729, Word 3951, Word 4186, Word 4435, Word 4699, Word 4978, Word 5274, Word 5588, Word 5920, Word 6272, Word 6645 ' -----[ Initialization ]-------------------------------------------------- ' counter = 0 ' Initialize counter. GOSUB FindEquals
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/23/2010 for the course EECC 0306-201 taught by Professor Roymelton during the Spring '10 term at RIT.

Page1 / 4

MicroMusicWithRtttl - ' What's a Microcontroller -...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online