volatile uint8_t x = SPI_read(LIS200DL_OUT_X);
if(x&& 0x80)
{
x ^ =( - 0 ^ x)& (1 以下为原文
I have done some further testing. It does seem to be functioning! I guess I was not quite 'accelerating' it the way it needs to in order to register. I may need to do some adjustment on the filters and/or data rate. Can you explain the data output? Here's what I'm doing with th output value. Checking the first bit, if it's 0, mask it and invert the others. Otherwise don't adjust. The values don't seem right for how it is being moved. Here's the code:
volatile uint8_t x = SPI_read( LIS200DL_OUT_X );
if( x && 0x80 )
{
x ^= (-0 ^ x) & (1 << 8);
valX = x ^ 1;
}
else
{
valX = x;
}
Is this correct?
Thanks again....