Meadow.Foundation.Grove.Sensors.Motion.PIRMotionSensor
PIRMotionSensor | |
---|---|
Status | |
Source code | GitHub |
NuGet package |
Code Example
PIRMotionSensor motionSensor;
public override Task Initialize()
{
motionSensor = new PIRMotionSensor(
Device.CreateDigitalInterruptPort(
Device.Pins.D13,
InterruptMode.EdgeBoth,
ResistorMode.Disabled));
motionSensor.OnMotionStart += (sender) =>
{
Resolver.Log.Info($"Motion start {DateTime.Now}");
};
motionSensor.OnMotionEnd += (sender) =>
{
Resolver.Log.Info($"Motion end {DateTime.Now}");
};
return Task.CompletedTask;
}
Sample project(s) available on GitHub
Wiring Example
PIRMotionSensor | Meadow Pin |
---|---|
GND | GND |
VCC | 3.3V |
RX | D01 |
TX | D00 |
Class PIRMotionSensor
Represents a PIR motion sensor
Assembly: PIRMotionSensor.dll
View Source
Declaration
public class PIRMotionSensor : ParallaxPir, IDisposable
Inheritance: System.Object
-> Meadow.Foundation.Sensors.Motion.ParallaxPir
Implements:
System.IDisposable
Implements
System.IDisposable