Following the instructions in the led-blink sample, we will connect pin 17 (GPIOA17) to the cathode of a LED interposing a resistor, and pin 39 (GND) to the anode.
class Program { static void Main(string[] args) { var pin = 17; var lightTimeInMilliseconds = 1000; var dimTimeInMilliseconds = 200;
Console.WriteLine($"Let's blink an LED!"); using (GpioController controller = new GpioController()) { controller.OpenPin(pin, PinMode.Output); Console.WriteLine($"GPIO pin enabled for use: {pin}");
As we've done in the previous note, we will configure our tasks.json and launch.json files in order to allow remote debugging via ssh
Only one caveat has to be considered this time in order to allow vsdg to change the mode of a pin.
In fact, this operation requires root permissions, and to get this result, one possible way is to prepend sudo before the vsdbg path in the launch.json configuration.
"debuggerPath": "sudo ~/vsdbg/vsdbg"
The following video shows a remote debug test of the program, and demonstrate that.
The Microsoft .NET Core IoT Libraries works as expected;
We are able to use the remote debugger stopping code execution at our breakpoints
The code of this note is available here on my Github repo.
As always
Enjoy,
and if we are still under COVID-19 attack, #staysafe, #StayAtHome.