Read data from MPU-6050 accelerometer using I2C
Posted: Sun Jan 10, 2016 7:45 pm
Hi, I am not new to flowcode but this is my first post and I am new to I2C.
I am trying to connect an MPU-6050 accelerometer to a pic 16f1829. The application is I have the accelerometer attached to a platform, that we drop a weight onto. I need to be able to measure the impact G forces and display them on an LCD display. The impact time is very small, and we need to capture the max G-force spike. ultimately, I want to set up a loop that is reading the data from the accel as fast as possible, compare it to the previous reading, and if it is larger, save it to the DataMax variable (or whatever variable I choose), and then display it. The problem I am having is I can't get the uC to talk to the accel. I have included my flowchart. I don't have any of the Saving, Comparing, Replacing code as that should be fairly straight forward, I need to be able to read the data first. Any help is appreciated. Thank you.
Richard
EDIT: The MPU-6050 device address and register address, are included in the file.
I am trying to connect an MPU-6050 accelerometer to a pic 16f1829. The application is I have the accelerometer attached to a platform, that we drop a weight onto. I need to be able to measure the impact G forces and display them on an LCD display. The impact time is very small, and we need to capture the max G-force spike. ultimately, I want to set up a loop that is reading the data from the accel as fast as possible, compare it to the previous reading, and if it is larger, save it to the DataMax variable (or whatever variable I choose), and then display it. The problem I am having is I can't get the uC to talk to the accel. I have included my flowchart. I don't have any of the Saving, Comparing, Replacing code as that should be fairly straight forward, I need to be able to read the data first. Any help is appreciated. Thank you.
Richard
EDIT: The MPU-6050 device address and register address, are included in the file.