You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using a Raspberry Pi 2 B+ with Raspbian Jessie and am writing a Windows Forms application that's running on Mono.
The app runs fine. It is supposed to run on an LCD Display.
The display works fine too. According to the specs it has 3 switches connected to GPIO Pins 17, 22 and 27.
I'm a Programmer, not a hardware engineer. I think I figured out that those GPIO Pins are on the real (physical) pins 11, 13 and 15. (Why they are numbered differently is beyond me.)
In the application I want to fire a function when the buttons are pressed.
private void SwitchPressed(bool x, int switchId)
{
Label_TestLabel.Text = "Switch " + switchId + " is now " + (x ? "High" : "Low");
}
I don't know what I'm doing wrong. And there isn't any documentation on how to read from an input and fire on events.
Unfortunately I'm developping on windows and can't debug the code in VS because the windows machine doesn't have the GPIO hardware, of course.
Here is the exception I got:
EXCEPTION
Exception time: 05.02.2018 10:38:03.3573
Exception message: Object reference not set to an instance of an object
Exception source: Raspberry.IO.GeneralPurpose
Help link:
================================================================================
Stack Trace:
at Raspberry.IO.GeneralPurpose.GpioConnection.Allocate (Raspberry.IO.GeneralPurpose.PinConfiguration configuration) [0x00073] in <39616ab275014559a5b975fe859e9ad9>:0
at Raspberry.IO.GeneralPurpose.GpioConnection.Open () [0x00036] in <39616ab275014559a5b975fe859e9ad9>:0
at Raspberry.IO.GeneralPurpose.GpioConnection..ctor (Raspberry.IO.GeneralPurpose.GpioConnectionSettings settings, System.Collections.Generic.IEnumerable`1[T] pins) [0x000f8] in <39616ab275014559a5b975fe859e9ad9>:0
at Raspberry.IO.GeneralPurpose.GpioConnection..ctor (Raspberry.IO.GeneralPurpose.PinConfiguration[] pins) [0x00000] in <39616ab275014559a5b975fe859e9ad9>:0
at myApp.FormMyApp..ctor () [0x001ce] in <e622084571bb433199911dfa030a90f2>:0
================================================================================
this things happens because of the processor, if you are using pi3 then the processor is bcm2835 which is not implemented in Raspberry.IO.GeneralPurpose package. to solve this issue try to install Raspberry.IO.GeneralPurpose3 -Version 3.1.1.
Link: https://nuget.org/packages/Raspberry.IO.GeneralPurpose3/
I'm using a Raspberry Pi 2 B+ with Raspbian Jessie and am writing a Windows Forms application that's running on Mono.
The app runs fine. It is supposed to run on an LCD Display.
The display works fine too. According to the specs it has 3 switches connected to GPIO Pins 17, 22 and 27.
I'm a Programmer, not a hardware engineer. I think I figured out that those GPIO Pins are on the real (physical) pins 11, 13 and 15. (Why they are numbered differently is beyond me.)
In the application I want to fire a function when the buttons are pressed.
Here is what I got:
in Form class:
in Form ctor:
and
I don't know what I'm doing wrong. And there isn't any documentation on how to read from an input and fire on events.
Unfortunately I'm developping on windows and can't debug the code in VS because the windows machine doesn't have the GPIO hardware, of course.
Here is the exception I got:
The output from the debug code:
The text was updated successfully, but these errors were encountered: