help hex numbers..
TomRiddle
Posts: 9
ok .. i cant find anything helpful..· i'm trying to· read data in hex format with the serin command...·· how can i store all of the hex numbers in one variable?? is it possible??··i'm getting this codes..· $FF $DD $55 .. etc etc...· is it possible to have them all in one variable?? here's part of my code..·
a VAR Byte
b VAR Byte
c VAR Byte
d VAR Byte
m VAR Byte
f VAR Byte
g VAR Byte
h VAR Byte
i VAR Byte
listen:
SERIN 14,16468, [noparse][[/noparse]WAIT($15), a, b, c, d, m, f, g, h, i]
is it possible to instead of saving each and every hex code into one variable.. to have them all in one??·
hope u can help .. 10x
a VAR Byte
b VAR Byte
c VAR Byte
d VAR Byte
m VAR Byte
f VAR Byte
g VAR Byte
h VAR Byte
i VAR Byte
listen:
SERIN 14,16468, [noparse][[/noparse]WAIT($15), a, b, c, d, m, f, g, h, i]
is it possible to instead of saving each and every hex code into one variable.. to have them all in one??·
hope u can help .. 10x
Comments
My_array VAR Byte(9)
SERIN 14,16468, [noparse][[/noparse]WAIT($15), STR My_array\9]
The array would contain one byte in each of it's elements which could be acessed via their index, My_array(0), My_array(1) etc etc
Jeff T.
i just tried the code.. but i'm getting some problems..
when i debug the output ...
My_array(0) = $D5
My_array(1) = $AB
My_array(2) = $4B
when i should be getting...
a = $54
b = $6F
c = $6D
any ideas?? 10x
Jeff T.
a VAR Byte
b VAR Byte
c VAR Byte
d VAR Byte
m VAR Byte
f VAR Byte
g VAR Byte
h VAR Byte
i VAR Byte
SEROUT 15,$4054,2,[noparse][[/noparse]255,85,3,4,0,20,229]
listen:
SERIN 14,16468, [noparse][[/noparse]WAIT($15), a, b, c, d, m, f, g, h, i]
'
.
the data comes in .. after the ipod get the command to send the name of the ipod...·· serout...· ..·
is working fine.. i was just looking for a simpler way..·· bcuz i might be asking for the list of songs.. and that would take a lot of variables LOL
and no.. i tried with the 84 and i don't get anythign..
4800* 16572 188 24764 8380
9600* 16468 8 4 24660 8276
*The BS2, BS2e and BS2pe may have trouble synchronizing with the incoming serial stream
at this rate and higher due to the lack of a hardware input buffer. Use only simple variables
and no formatters to try to solve this problem.
.. yea.. i found this on the bs2 manual...··· ... i think that's the source of my problems.. grrrr
www.protean-logic.com/tickit/rsb509B_HTML_Cutsheet.htm
I'm not sure if you can set the output and input to different baud rates thought.
I'm still not sure what you mean by "hex strings" as hex is just a _number_ representation in base 16, where the additional NUMBERS A thu F are used. It takes two hex characters to make one byte.
The PBASIC Stamp has very limited RAM memory, so unless you plan on reading in (say) ten to twenty bytes (20 to 40 "hex strings") at a time, and then transferring them somewhere else (memory stick, EEPROM, etc.), you would be a whole lot better off transferring the data to a PC or something with more RAM.
I'm sure there are plenty of programs readily available for the PC which will accept data from an Ipod, or any other handheld device. If not, you could use something as simple as the Microsoft Windows utility Hyperterminal to create a file on a PC from th data received from your Ipod.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There is no pleasure in having nothing to do;
the fun is in having lots to do, and not doing it!