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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.