This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

accelerometer_result_error

Hello ,I wrote a program that allows to control the LIS2DE12 accelerometer but I am reviewing a fixed result which is always X = 72, Y = 33, Z = 32, I find out where the problem , thanks you in advance.

`int main(void)	
{
	int8_t X,Y,Z;
    
    uart_config();
    
    //accel_I2C_datawrite(&twi_instance);
    twi_init();
     m_device_address = accel_addr;
 
    uint8_t rx_buffer[6];
   rx_buffer[0] = 0x00;
//int threshold;
//accel_set_threshold(threshold);
    
        




            while(true)
        {
            accel_xyz_read(&X,&Y,&Z);
         printf("Groupeer accelero DATA2:  X: %d  Y: %d  Z: %d  \n", X ,Y,Z);
					nrf_delay_ms(1000);
        }      
    
}
`
Parents
  • I'm sorry but could you please delete all unused lines of code and repost? There are so many lines that are seemingly commented away and stacked after each other, I am not sure what is supposed to be here or not. Also could you please post the contents of the accel_I2C_register_write function?

    Secondly, have you made sure you are using the correct IC address for the chip, and do you follow the protocol as described in chapter 6.1.1 of the LIS2DE12 product specification?

Reply
  • I'm sorry but could you please delete all unused lines of code and repost? There are so many lines that are seemingly commented away and stacked after each other, I am not sure what is supposed to be here or not. Also could you please post the contents of the accel_I2C_register_write function?

    Secondly, have you made sure you are using the correct IC address for the chip, and do you follow the protocol as described in chapter 6.1.1 of the LIS2DE12 product specification?

Children
No Data
Related