Table of Contents

Class Hcsr501

Namespace
Iot.Device.Hcsr501
Assembly
Iot.Device.Hcsr501.dll

PIR Sensor HC-SR501

[Interface("PIR Sensor HC-SR501")]
public class Hcsr501
Inheritance
Hcsr501

Constructors

Hcsr501(int, PinNumberingScheme, GpioController?, bool)

Creates a new instance of the HC-SCR501.

public Hcsr501(int outPin, PinNumberingScheme pinNumberingScheme = PinNumberingScheme.Logical, GpioController? gpioController = null, bool shouldDispose = true)

Parameters

outPin int

OUT Pin

pinNumberingScheme PinNumberingScheme

Pin Numbering Scheme

gpioController GpioController

GpioController related with operations on pins

shouldDispose bool

True to dispose the Gpio Controller

Properties

IsMotionDetected

If a motion is detected, return true.

[Telemetry]
public bool IsMotionDetected { get; }

Property Value

bool

Methods

Dispose()

Cleanup

public void Dispose()

Events

Hcsr501ValueChanged

Triggering when HC-SR501 value changes

public event Hcsr501.Hcsr501ValueChangedHandle? Hcsr501ValueChanged

Event Type

Hcsr501.Hcsr501ValueChangedHandle