Shop OBEX P1 Docs P2 Docs Learn Events
Project Error — Parallax Forums

Project Error

RiskgamerRiskgamer Posts: 1
edited 2013-11-20 12:42 in BASIC Stamp
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

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2013-11-20 12:42
    Welcome to the forums! Your variable declarations are not formatted correctly. You're missing the word VAR between the variable name and its size.

    For example your first declaration should look like this:
    index   VAR   Word
    

    I would recommend code tags be used in the future to paste code so the formatting is not lost.
Sign In or Register to comment.