Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
HI , we are developing an application which requires to read the status of pin on raspberry pi board frequently (long polling) is there any library (dll) supports pin interrupts ? ie., if the pin is HIGH / LOW it should rise an event. i found this library for .net (https://github.com/danriches/WiringPi.Net) could any one please help me how to use that library ?
Posted
Updated 26-May-15 19:12pm
v2
Comments
Sergey Alexandrovich Kryukov 27-May-15 1:12am    
I already explained to you how to use the underlying native library: http://www.codeproject.com/Answers/990827/Raspberry-Pi-Pin-State-change-event#answer1.

Why would you re-post the same thing in CLR variant? You could grasp the idea in first place, or ask some follow-up questions, or try to use P/Invoke on your own...

So, it's unclear what help you do you need...

Here is the deal: you can try to find solution by yourself and show some minimal code. If something doesn't work, I'll try to help you. I don't have Raspberry PI units, and not having it it's hard to write working code. But the WiringPI operation documentation looks quite clear to me.

—SA
[no name] 27-May-15 1:17am    
Although SA has done his best why are you not on the R Pi forum for this question? That is always better than hoping someone on a general forum knows the answer.
Sergey Alexandrovich Kryukov 27-May-15 2:09am    
Not quite. Now, I also found some very basic code sample using wiringPi directly; please see Solution 2.
—SA

1 solution

In addition to my past answer where I explained the idea (Raspberry Pi Pin State change event[^]):

This is a very good article with code samples using libwiringPi:
http://java.dzone.com/articles/controlling-led-raspberry-pi-2[^].

Note that the code sample does not even use the libwiringPi wrapper for CLR. Instead, P/Invoke is just used directly, to use the native library code. Exactly as I suggested to you in first place.

This should be quite enough for you to understand how you can proceed. You can use it in combination with my explanations in my answer to your previous question.

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900