2011_ACTIVITY #4 - MICROCONTROLLER MUSIC

2011_ACTIVITY #4 - MICROCONTROLLER MUSIC - D READ Notes +...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
' What's a Microcontroller - NotesAndDurations.bs2 ' Play the first few notes from Frere Jacques. ' '{$STAMP BS2} '{$PBASIC 2.5} ' DEBUG "Program Running!" D Notes DATA "C","D","E","C","C","D","E","C","E","F", "G","E","F","G","Q" Durations DATA 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 4, 4, 2 WholeNote CON 2000 W index VAR Byte offset VAR Nib o noteLetter VAR Byte noteFreq VAR Word noteDuration VAR Word n DO UNTIL noteLetter = "Q"
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: D READ Notes + index, noteLetter LOOKDOWN noteLetter, [ "A", "b", "B", "C", "d", "D", "e", "E", "F", "g", "G", "a", "P", "Q" ], offset LOOKUP offset, [ 1760, 1865, 1976, 2093, 2217, 2349, 2489, 2637, 2794, 2960, 3136, 3322, 0, 0 ], noteFreq READ Durations + index, noteDuration noteDuration = WholeNote / noteDuration FREQOUT 9, noteDuration, noteFreq index = index + 1 LOOP L END...
View Full Document

This note was uploaded on 01/10/2011 for the course EE 1244 taught by Professor Drera during the Fall '10 term at Conestoga.

Ask a homework question - tutors are online