Project Error
Riskgamer
Posts: 1
I am attempting to play notes stored in EEPROM and it says I'm missing a variable but as i review my program it look fine.... Any help?
' {$STAMP BS2}
' {$PBASIC 2.5}
notes DATA "A", "B", "C", "D"
Frequency DATA Word 2000, Word 4000, Word 6000, Word 8000
Duration DATA Word 500, Word 500, Word 500, Word 500
index Word
Noteletter Byte
notefreq Word
noteduration Word
FOR index = 0 TO 3
READ notes + index, noteletter
DEBUG " ", noteletter
READ Frequency + (index * 2), Word notefreq
DEBUG " ", DEC4 notefreq
READ duration + (index * 2), noteduration
DEBUG " ", DEC4 noteduration, CR
FREQOUT 9, noteduration, notefreq
NEXT
END
' {$STAMP BS2}
' {$PBASIC 2.5}
notes DATA "A", "B", "C", "D"
Frequency DATA Word 2000, Word 4000, Word 6000, Word 8000
Duration DATA Word 500, Word 500, Word 500, Word 500
index Word
Noteletter Byte
notefreq Word
noteduration Word
FOR index = 0 TO 3
READ notes + index, noteletter
DEBUG " ", noteletter
READ Frequency + (index * 2), Word notefreq
DEBUG " ", DEC4 notefreq
READ duration + (index * 2), noteduration
DEBUG " ", DEC4 noteduration, CR
FREQOUT 9, noteduration, notefreq
NEXT
END
Comments
For example your first declaration should look like this:
I would recommend code tags be used in the future to paste code so the formatting is not lost.