Hex data conversion question.
Wookie
Posts: 27
Forum,
First off, thanks to everyone whom has helped me in the past around here. This forum has been invaluable.
My question revolves around hex data strings. I am receiving 64 bit identity data from several 1-wire temp devices. I would like to match these to constants I have defined at the top of my program. I can display the serial number by using "debug.hex(long [noparse][[/noparse]addr] ,8" and see the hex char's "8F917A28", but when I try to match this to the same ID defined in my constants section "$8F917A28", by using the == function, I don't have a successful match. How do I convert this data so I can compare it to a constant so I can use an if, else routine to make a decision in the software? I would publish my code, but I am away from my work machine.
Thanks for your help!
First off, thanks to everyone whom has helped me in the past around here. This forum has been invaluable.
My question revolves around hex data strings. I am receiving 64 bit identity data from several 1-wire temp devices. I would like to match these to constants I have defined at the top of my program. I can display the serial number by using "debug.hex(long [noparse][[/noparse]addr] ,8" and see the hex char's "8F917A28", but when I try to match this to the same ID defined in my constants section "$8F917A28", by using the == function, I don't have a successful match. How do I convert this data so I can compare it to a constant so I can use an if, else routine to make a decision in the software? I would publish my code, but I am away from my work machine.
Thanks for your help!
Comments
Propeller Manual, Pag. 308
In the Con section you cannot define strings.....
So you must have done
NOT....
But if you post your code ...either as an attached file or if it is short use the # button in the posting editor...we can see what is going
wrong and we can suggest a better answer....
if you have a pointer to the value then
if long[noparse][[/noparse]adr] == vvv·· ...... should work
but code will make it easier to help
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Samuel
www.RobotBASIC.com
Post Edited (SamMishal) : 1/8/2010 11:19:49 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cmapspublic3.ihmc.us:80/servlet/SBReadResourceServlet?rid=1181572927203_421963583_5511&partName=htmltext
Hello Rest Of The World
Hello Debris
Install a propeller and blow them away
Sam,
Thank you very much for your reply, using "long[noparse][[/noparse]adr] == vvv" totally solved my problem. I figured it was just an issue of me not knowing the proper syntax in Spin to get the job done.
The "quotes" issue you commented on was just me wrapping my variable names in quotes for clarity. I know for next time this may be confusing,
Anyway, I owe you all a beer for your help! Thanks again!!