I2C access from Windows without Arduino Firmata?

userHead ikue 2022-04-08 23:20:02 1167 Views4 Replies

Hi there,

I am new to the LattePanda Delta. Despite a lot of research on this topic, it is not clear to me yet how I2C can be accessed with this board.

As far as I understood, there are two options for I2C connectivity:
a) indirectly via the Leonardo (with Arduino Firmata) and Arduino ports on the board (D2 / D3 for SDA / SCL)
b) directly via Windows.Devices.I2C namespace and dedicated I2C pinouts on the board
-> purple circled area with 1.8 V, https://docs.lattepanda.com/content/delt ... layability

I need to use C# to access I2C. The ideal way would be directly, so option b.

After preparing a test program, I found out the following:
deviceSelector = I2cDevice.GetDeviceSelector();
controllers = await DeviceInformation.FindAllAsync(deviceSelector);
Problem: There are no controllers found.

Also if I try to access the I2C bus later on by
settings = new I2cConnectionSettings(MCP23017_ADDRESS1);
settings.BusSpeed = I2cBusSpeed.FastMode;
controller = await I2cController.GetDefaultAsync();
"controller" remains null and cannot be accessed.

Does anybody have a solution or suggestion for accessing the I2C bus directly from Windows?