Shop OBEX P1 Docs P2 Docs Learn Events
Another Bit of Help Needed: A byte array — Parallax Forums

Another Bit of Help Needed: A byte array

DiablodeMorteDiablodeMorte Posts: 238
edited 2008-04-09 03:56 in Propeller 1
I've reached another snag in my project(The first being the high byte low byte problem[noparse][[/noparse]see other post]): I need to be able to pass a 32 byte array to a function. I've defined the variable:
Var
Byte song[noparse][[/noparse]32]
Pub Main
song[noparse][[/noparse]0] = blah
song = blah
song = blah
song = blah
song = blah
...etc




and now I need to pass it to function load_song... and access each byte

I've tried:
Load_Song(song)
PUB Load_Song(data_array)
data_array.Byte[noparse][[/noparse]0]



With no luck, I even tried using pointers.. but that just caused the robot to produce a general fault. Any suggestions?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Current Projects:
Robot Control Via Skype API - Dev Stage(50% Complete) - Total(25%)
Robot Localization Via Xbee's - Research Stage
IR Tracking with Propeller - Research Stage

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-04-09 03:56
    This should help you:
    ...
     Load_Song(@song)
    ...
    PUB LOad_Song(fname)
     BYTE[noparse][[/noparse]fname][noparse][[/noparse]0]
     
    DAT
     song BYTE "song.wav",0
     
    


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
Sign In or Register to comment.