Step 4Song storage code explained
control:
Start timer
Wait for timer overflow
Loop a certain number of times (this is the note length)
increment note number
Song data:
is the note number =1?
if so, output the correct number out port A, PIN0, and load the note length into a register
if not, continue
is the note number=2?
...
...
ad nauseum, over 300 notes
...
...
is the song finished?
if yes, clear all registers
if not, return to the "wait for timer overflow" step, with the correct note length value in the appropriate register. It will then increment note number and return to the "song data" function.
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|





































