3 Replies Latest reply on Feb 16, 2018 12:36 AM by anhac_1780096

    MPU 6050 - Need help reading sensor values



      For a project I need to read out the sensor values of the MPU 6050.

      After doing some research I downloaded the project in this topic from 3 months ago MPU6050 w/PSOC4 - Implementing a Filter


      The only problem I am facing is that I am getting errors that there are too few arguments in the I2C functions provided by PSoC after I build the project.


      For example code for reading a byte of data:

      void I2CReadBytes(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint8_t *value) {

           uint8_t i=0;

           I2C_MPU6050_I2CMasterSendStart(devAddr, I2C_MPU6050_I2C_WRITE_XFER_MODE);


           I2C_MPU6050_I2CMasterSendRestart(devAddr, I2C_MPU6050_I2C_READ_XFER_MODE);

           while (i++ < (length-1)) {

                *value++ = I2C_MPU6050_I2CMasterReadByte(I2C_MPU6050_I2C_ACK_DATA);


           *value = I2C_MPU6050_I2CMasterReadByte(I2C_MPU6050_I2C_NAK_DATA);




      These functions expect more parameters now than the project that I downloaded from 3 months ago, while the project is still PSoC 4.

      Is it possible to avoid these errors so I can use this project to read the data?


      Thanks for reading