Shop OBEX P1 Docs P2 Docs Learn Events
Hitachi Tri-Axis Accelerometer Help — Parallax Forums

Hitachi Tri-Axis Accelerometer Help

Commander_BobCommander_Bob Posts: 17
edited 2007-04-17 01:04 in BASIC Stamp
I need help with my Hitachi Tri-Axis Accelerometer. I have looked for info but I could only find the documentation. I understand most of the demo code but I don't get what the [noparse][[/noparse]%11\2, VRef\3] and [noparse][[/noparse]%11\2, axis\3] do. What do they mean? I know if you sub 0, 1 , or 2 for axis then it selects different axis to give the data on but that is the %11\2 and why is axis\3? Thanks.

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-04-16 14:47
    Bob,

    The commands are sending out two ones (bits) for the command to read the register. The register number you want to read is also encoded into the data you’re sending (the next 3 bits). The SHIFTOUT command is being told to send out these 5 bits as specified. I hope this helps. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Skywalker49Skywalker49 Posts: 172
    edited 2007-04-16 14:52
    CB,

    look in the Basis Stamp Programming Manual SHIFTOUT .. %11 means: binary number 11
    and %11/2 within the SHIFTOUT command results in 2 bits will be transmitted to the output.

    To fully understand the code, you must study the SHIFTOUT / SHIFTIN commands

    good luck,
    Ed
  • Commander_BobCommander_Bob Posts: 17
    edited 2007-04-17 01:04
    Thanks it makes more sense now. Now I need a way to use negatives. If I use the ABS command then I get the right numbers but I need one to be negative so I can use + and - Gs. Any suggestions? Thanks.
Sign In or Register to comment.