marcc70
Posts: 13
Joined: Fri Mar 08, 2019 8:28 am

WiringPi c# visual studio 2017

Fri Mar 08, 2019 8:36 am

Hi there,

I have got this error if I am debugging my c# application: System.DllNotFoundException: can not load DLL libwiringPi.so n: (HRESULT: 0x8007007E)'

What I want is to set outputs on my raspberry Pi high and low with a button, and maybe expand it after that.

What I did is, I added a refrence library of WiringPi.
All commands are recognized in my code, but when I debug I get the error.
It seems like the library is not added well..?

Code:

Code: Select all

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using WiringPi;

namespace Relais1._2
{ 
    public partial class Form1 : Form
        

    {
        public Form1()
        {
            InitializeComponent();
            const int redLedPin = 11;
           
        }

        private void button1_Click(object sender, EventArgs e)
        {
            const int redLedPin = 11;
           // GPIO.pinMode(redLedPin, (int)GPIO.GPIOpinmode.Output);
            GPIO.digitalWrite(11, (int)GPIO.GPIOpinvalue.High);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            const int redLedPin = 11;
            //GPIO.pinMode(redLedPin, (int)GPIO.GPIOpinmode.Output);
            GPIO.digitalWrite(11, (int)GPIO.GPIOpinvalue.Low);
        }
    }
}
Hope someone can help me out, I will apprreciate that.
Thanks in advance.

Best regards,

Marc

marcc70
Posts: 13
Joined: Fri Mar 08, 2019 8:28 am

Re: WiringPi c# visual studio 2017

Mon Mar 18, 2019 9:30 am

Hi there,

I was wondering if anyone has a solution for this?
Really want to get this working.

User avatar
joan
Posts: 13925
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: WiringPi c# visual studio 2017

Mon Mar 18, 2019 2:34 pm

wiringPi is a Linux based GPIO library. Has it been ported to Windows?

marcc70
Posts: 13
Joined: Fri Mar 08, 2019 8:28 am

Re: WiringPi c# visual studio 2017

Thu Mar 28, 2019 8:24 am

Well I am back,

I found another easy solution, I made a GUI in Python 3 and from there on it is easy to control the GPIO of the Raspberry Pi 3B+.
Somehow it should be possible I guess with visual studio, but I have no time at the moment to discover that out.

Return to “Windows 10 for IoT”