8 years ago.

Interfacing mbed - LPC1768 with STEVAL-MKL159V1 (LSM9DS1 adapter board) through I2C

Hello Guys my question is how to interface the mbed - LPC1768 with STEVAL-MKL159V1 (LSM9DS1 adapter board) through I2C. Does anyone has an example code, of just how to start the communication with the sensor.

This is what I have for now, which is just the constructor, which I dont know if its right. I am starting in this field I will appreciate any help, thanks in advance:

Header file:

public: LSM9DS1(PinName sda, PinName scl, int ag_addr ,int m_addr); private: I2C m_i2c; int mAddr, agAddr, scale;

cpp file:

LSM9DS1::LSM9DS1(PinName sda, PinName scl, int ag_Addr ,int m_Addr) : m_i2c(sda, scl), agAddr(ag_Addr) , mAddr(m_Addr) { Initialize members scale = DEFAULT_FSR;

}

I already have all the registers defined

Be the first to answer this question.