I want to use a Barometer 2 Click (LPS35HW) but so far enable to read or write correctly in the various register
One of the register is called WHO_AM_I (register 0x0F) and is supposed to return the value 10110001.
Every time I got the value 0x22 instead of 0xB1.
Writing a value and reading back in any of the R/W register do not work,returned values are incorrect but always the same
Could a defective chip always return the same value ?
public Barometer2Click(bool lowBusSpeed,string i2CControllerName)
{
var settings = new I2cConnectionSettings(0xB8, (uint) (lowBusSpeed ? 100_000 : 400_000));
var controller = I2cController.FromName(i2CControllerName);
Barometer2 = controller.GetDevice(settings);
Thread.Sleep(1000);
}
/// <summary>
/// Initialisation of the PLS35HW (set bit 2)
/// </summary>
public bool Initialization()
{
// Read Register WHO_AM_I (0x0F) : should be 10110001
byte[] rxBuffer = new byte[1];
Barometer2.WriteRead(new[] {WhoAmI}, rxBuffer);