the only thing I am sure of is you have a mismatch in your project between library versions and the version of firmware you have installed. Start a new project to make sure you’ve now got the correct/latest assemblies.
As soon as I add the below as per your example, it fails
var settings = new I2cConnectionSettings(0x40, 100_000); //The slave's address and the bus speed.
var controller = I2cController.FromName(SC13048.I2cBus.I2c1);
var device = controller.GetDevice(settings);-
If your project has package folder (VS2019), you need to delete them.
If your project doesn’t have package folder (VS2022), usually VS nuget cached here:
Exception thrown: ‘System.Exception’ in GHIElectronics.TinyCLR.Devices.I2c.dll
An unhandled exception of type ‘System.Exception’ occurred in GHIElectronics.TinyCLR.Devices.I2c.dll