Accelerometer
Commander_Bob
Posts: 17
In the demo code for the· Hitachi H48C TriAxis Accelerometer Module does any one know what %11\2 means? I think \2 means 2 bits but what is %11? I am trying to use the accelerometer and I am writing the code in C so I need to know what this means. Does it have a hexadecimal equivalent that could be sent to the chip?
Thanks
Thanks
Comments
%11 is PBASIC for binary 11 (which is decimal '3')
\2 is PBASIC, too, telling the STAMP that it'll SHIFTOUT two bits.
The axis variable is 3 bits.
If it was %1010\4 then it'd send out binary 1010 (decimal '10') with the further notation to SHIFTOUT 4 bits.
So you tell it the number to send and how many bits it is.
Not to be picky, but the word "number" could be misunderstood when you said:
"So you tell it the number to send and how many bits it is."
Might be better stated as:
So you tell it the value to send and how many bits it is.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔