How to detect the motion of the object using PIR Sensor and How to define the LED states

To detect the motion of an object, an important sensor is PIR. For that, first you need to define a variable for the PIR sensor by setting the respective pin number into it. You need to define a variable for the LED sensor and set it to its respective Pi number, as explained in the step 1 in the following list. By using these pin numbers, we will identify whether the PIR sensor detected an object or not; based on the PIR sensor value, you will turn the LED light on/off.

  1. Open the MainPage.xaml.cs file and declare the following properties at the top of the class, as follows:
       //Status LED variables         private const int LED_PIN = 5; private GpioPin PinLED; ...

Get Building Bots with Microsoft Bot Framework now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.