PDA

View Full Version : Hitachi Tri-Axis Accelerometer Help



Commander_Bob
04-16-2007, 08:35 AM
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 [%11\2, VRef\3] and [%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.

Chris Savage
04-16-2007, 09:47 PM
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

Skywalker49
04-16-2007, 09:52 PM
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_Bob
04-17-2007, 08:04 AM
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.