Skip to main content

Meadow.Foundation.Grove.Sensors.Motion.PIRMotionSensor

PIRMotionSensor
StatusStatus badge: working
Source codeGitHub
NuGet packageNuGet Gallery for Meadow.Foundation.Grove.Sensors.Motion.PIRMotionSensor

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

PIRMotionSensorMeadow Pin
GNDGND
VCC3.3V
RXD01
TXD00