我正在尝试从树莓派中读取光传感器的值,但我得到的只是“低”或“高”:
using System;
using RaspberryPiDotNet;
namespace Test_PI
{
class Program
{
static void Main(string[] args)
{
GPIOMem ldr = new GPIOMem(GPIOPins.V2_GPIO_23, GPIODirection.In);
while (true)
{
Console.WriteLine("Sensor: " + ldr.Read().ToString());
}
}
}
}