C# Raspberry Pi 2 Libbcm2835库RaspberryPiDotNet异常
我是新来的覆盆子派 我正在使用monodevelop,在导入库C# Raspberry Pi 2 Libbcm2835库RaspberryPiDotNet异常,c#,mono,raspberry-pi,monodevelop,raspberry-pi2,C#,Mono,Raspberry Pi,Monodevelop,Raspberry Pi2,我是新来的覆盆子派 我正在使用monodevelop,在导入库RaspberryPiDotNew以控制GPIO之后- 我运行了一个简单的脚本,得到了一个异常: using System; using RaspberryPiDotNet; namespace Test { class Program { static void Main(string[] args) { GPIOMem led = new GPIOMem(G
RaspberryPiDotNew
以控制GPIO之后-
我运行了一个简单的脚本,得到了一个异常:
using System;
using RaspberryPiDotNet;
namespace Test
{
class Program
{
static void Main(string[] args)
{
GPIOMem led = new GPIOMem(GPIOPins.V2_GPIO_12)
while(true)
{
led.Write(PinState.High);
System.Threading.Thread.Sleep(500);
led.Write(PinState.Low);
System.Threading.Thread.Sleep(500);
}
}
}
}
我发现错误System.TypeInitializationException已抛出
System.TypeInitializationException : An exception was thrown by the type initializer for RassberryPiDotNet.GPIOMem --->System.Exception:libbcm2835.so
at (wrapper managed-to-native)RaspberryPiDontNet.GPIOMem:bcm2835_init()
at RaspberryPiDotNet.GPIOMem..cctor()[0x00001]in
您是否以root用户身份执行此操作?libbcm需要提升权限才能运行,那么在这种情况下我应该怎么做?以root或sudo身份运行它?如何执行?我是说命令,对不起,我从来没有用过linuxsudo mono yourexe.exe