已回答假定已回答

ADXL345加速度值疑问

a10642525 在 2014-3-24 詢問的問題
最後回覆由adi_rock於2014-3-26提供

小弟最近使用msp430读出三轴加速度计

无奈读出来的值看不懂,不知如何转换

望各位大得过眼

以下附上小弟代码

 

 

P1OUT &= ~(1<<4);

  Send_UCB0Byte(0x31);

  Send_UCB0Byte(0x0b);

   Delay_1ms(1);

  P1OUT |= (1<<4);

 

  P1OUT &= ~(1<<4);

  Send_UCB0Byte(0x2c);

  Send_UCB0Byte(0x08);

   Delay_1ms(1);

  P1OUT |= (1<<4);

 

P1OUT &= ~(1<<4);

  Send_UCB0Byte(0x2d);

  Send_UCB0Byte(0x08);

   Delay_1ms(1);

  P1OUT |= (1<<4);

 

P1OUT &= ~(1<<4);

  Send_UCB0Byte(0x80+0x33);//读出x1

Send_UCB0Byte(0x00);

Delay_1ms(1);

  P1OUT |= (1<<4);

 

  P1OUT &= ~(1<<4);

  Send_UCB0Byte(0x80+0x32);读出x0

Send_UCB0Byte(0x00);

y=UCB0RXBUF;

   Delay_1ms(1);

  P1OUT |= (1<<4);

結果