Shop OBEX P1 Docs P2 Docs Learn Events
Hex v Dec v Binary — Parallax Forums

Hex v Dec v Binary

kevinb2050kevinb2050 Posts: 56
edited 2008-09-30 02:09 in BASIC Stamp
Is there a general rule of thumb as to when to use Hex, Dec or binary numbering with the stamp. I understand the different systems but am at a loss as to when each should be used. Is it a matter of memory, time, or floating point that determines which should be used. I note a lot of sample programs use a combination of all.

Comments

  • FranklinFranklin Posts: 4,747
    edited 2008-09-30 01:42
    To the stamp they are all the same (binary) the only reason to use one over the other is how easy it will be to understand the reason you are using the number. Most will use binary when setting direction or high/low values of a port and hex or decimal depending on the documentation for the part you might be controlling.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • kevinb2050kevinb2050 Posts: 56
    edited 2008-09-30 01:58
    Thanks Franklin,
    So it is only a personal preference to use Hex or Decimal, other than when specified by an external component
  • FranklinFranklin Posts: 4,747
    edited 2008-09-30 02:06
    Not really, you can use either but if the component says ' send a 6f,fe,cd' do you want to do the math every time?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • kevinb2050kevinb2050 Posts: 56
    edited 2008-09-30 02:09
    Thanks again, I get the message - why complicate things when you don't have too
Sign In or Register to comment.