This sample demonstrates how to communicate with GPIO using the Micorosot.IoT.Lightning.Providers.I2cProvider
It’s based on the Blinky UI sample and shares the same setup steps. The main difference is setting the Lightning provider as the default controllers provider.
The original code of the Blinky sample used the default GPIO provider for obtaining the GPIO controller:
To enable the use of the Lightning provider, the GPIO controller initialization code needs to be modified to set the Lightning provider as the default provider.
In the initialization code below, if the Lightning driver is enabled on the target device, the Lightning provider will be used. Otherwise, the app falls back to using the default provider.
Enable Lightning on your Raspberry Pi2 or MBM device using the the steps outlined in the Lightning Setup Guide.
Ensure the correct version of the Windows SDK is installed on your development machine. The required Windows SDK can be installed from here.
Clone the source for the Blinky sample for Lightning from Github to a local folder.
To setup the LED connectons, refer to the original Blinky sample.
Load the solution in Visual Studio.
Select “Blinky (Univeral Windows)” as the startup project.
Build the app.
Deploy and run the app on your device. You can use the Deploying an App with Visual Studio for guidance.