Shop OBEX P1 Docs P2 Docs Learn Events
OWOUT command — Parallax Forums

OWOUT command

Julien HordiesJulien Hordies Posts: 6
edited 2005-07-06 15:00 in BASIC Stamp
Hello,

I'm trying to make a domotic application with a Basic Stamp 2p24 and for this, I'm using the command OWOUT and OWIN with Dallas componend such as DS2405 and DS1820. For the DS2405, I try to use the matchRom command, followed by the 64 bits of the code of the componend, but It doesn't works if I'm using variable for that code. It only works with the direct characters written in hexa (or other), but not with a variable wich has this character.
This works : OWOUT OWpin,1,[noparse][[/noparse]MatchROM,$05,$B3,$82,$00,$00,$00,$00,$DF],
but this doesn't works : OWOUT OWpin,1,[noparse][[/noparse]MatchROM,HEX2 code1,HEX2 code2,HEX2 code3,HEX2 code4,HEX2 code5,HEX2 code6,HEX2 code7,HEX2 code8] and I'm sure that the variable code1=05 etc...

Can you help me?


Thank you.


Julien Hordies

P.S:sorry for my english, but I'm Belgian.

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-07-06 13:43
    Remove the HEX2 modifier from your OWOUT command. The HEX2 modifier converts one byte to a two-byte string representation of the value; this is useful for terminal type devices but no needed elsewhere. Just do this:

    · OWOUT OWpin, 1, [noparse][[/noparse]MatchROM, code1, code2, code3, code4, code5, code6, code7, code8]

    And here's another trick if you've defined code1..code8 in order in your declarations:

    · OWOUT OWpin, 1, [noparse][[/noparse]MatchROM, code1\8]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Julien HordiesJulien Hordies Posts: 6
    edited 2005-07-06 15:00
    Thank you very much.

    It works...
Sign In or Register to comment.