I'm trying the new System.Device.Gpio
library in .NET Core (https://github.com/dotnet/iot) with my Raspberry PI 3B+, but the I2C communication is giving me some trouble.
I want to reproduce the behavior of some python code that is already working, starting with some simple data writing and reading:
I2cConnectionSettings settings = new I2cConnectionSettings(1, 0x18); // I2C BUS is 1, ADDRESS is 0x18
I2cDevice device = I2cDevice.Create(settings);
device.WriteByte(8);
Console.WriteLine("Byte written: " + device.ReadByte().ToString());
The result is giving me is always 0
, without any error, while the expected result should be 8
.
What could it be?