从Raspberry Pi读取光传感器值时出现问题

时间:2018-12-30 12:38:23

标签: c# raspberry-pi

我正在尝试从树莓派中读取光传感器的值,但我得到的只是“低”或“高”:

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());
        }
    }
}
}

0 个答案:

没有答案