The following program fails when registering the third pin’s ValueChanged event. No matter which pin is the third. The first 2 pins registration don’t fail. I am using 2.1.0-rc2
using System.Diagnostics;
using GHIElectronics.TinyCLR.Devices.Gpio;
using GHIElectronics.TinyCLR.Pins;
namespace IssueWithButtons
{
class Program
{
static void Main()
{
var gpioController = GpioController.GetDefault();
GpioPin ldrPin = gpioController.OpenPin(SC20260.GpioPin.PE3);
GpioPin modePin = gpioController.OpenPin(SC20260.GpioPin.PD7);
GpioPin appPin = gpioController.OpenPin(SC20260.GpioPin.PB7);
ldrPin.ValueChanged += Pin_ValueChanged;
modePin.ValueChanged += Pin_ValueChanged;
// The third pin fails. No matter which one it is (ldr, mod or app);
appPin.ValueChanged += Pin_ValueChanged;
while (true) { }
}
private static void Pin_ValueChanged(GpioPin sender, GpioPinValueChangedEventArgs e)
{
Debug.WriteLine($"Pin: {sender.PinNumber} is {e.Edge == GpioPinEdge.FallingEdge}");
}
}
}
The error message doesn’t help: