Class C4001
Create a new C4001 object
Assembly: C4001.dll
View Source
public class C4001 : IC4001, ISensor, II2cPeripheral
Implements:
Meadow.Foundation.Sensors.Motion.IC4001, Meadow.Peripherals.Sensors.ISensor, Meadow.Hardware.II2cPeripheral
Properties
DefaultI2cAddress
The default I2C address for the peripheral
View Source
public byte DefaultI2cAddress { get; }
Methods
SetSensorMode(SensorMode)
Set the Sensor sampling mode
View Source
public bool SetSensorMode(C4001.SensorMode mode)
Returns
System.Boolean
Parameters
| Type | Name |
|---|---|
| Meadow.Foundation.Sensors.Motion.C4001.SensorMode | mode |
GetStatus()
Get the current status of the sensor
View Source
public C4001.SensorStatus GetStatus()
Returns
Meadow.Foundation.Sensors.Motion.C4001.SensorStatus: The current status of the sensor.
GetTargetNumber()
Get the target number
View Source
public byte GetTargetNumber()
Returns
System.Byte
GetTargetSpeed()
Gets the target speed from the sensor's buffer.
View Source
public Speed GetTargetSpeed()
Returns
Meadow.Units.Speed: The target speed as a float.
GetTargetRange()
Gets the target range from the sensor's buffer.
View Source
public Length GetTargetRange()
Returns
Meadow.Units.Length: The target range as a float.
GetTargetEnergy()
Gets the target energy from the sensor's buffer.
View Source
public uint GetTargetEnergy()
Returns
System.UInt32: The target energy as an unsigned integer.
IsMotionDetected()
Determines if motion is currently detected by the sensor.
View Source
public bool IsMotionDetected()
Returns
System.Boolean: true if motion is detected, otherwise false.
SetDetectionRange(ushort, ushort, ushort)
Sets the detection range for the sensor.
View Source
public void SetDetectionRange(ushort min, ushort max, ushort trig)
Parameters
| Type | Name |
|---|---|
System.UInt16 | min |
System.UInt16 | max |
System.UInt16 | trig |
SetTrigSensitivity(byte)
Sets the trigger sensitivity for the sensor.
View Source
public void SetTrigSensitivity(byte sensitivity)
Parameters
| Type | Name |
|---|---|
System.Byte | sensitivity |
SetKeepSensitivity(byte)
Sets the keep sensitivity for the sensor, which determines the sensor's ability to maintain detection of a target once triggered.
View Source
public void SetKeepSensitivity(byte sensitivity)
Parameters
| Type | Name |
|---|---|
System.Byte | sensitivity |
GetTargetEnergyI2c()
View Source
public uint GetTargetEnergyI2c()
Returns
System.UInt32
Implements
- Meadow.Foundation.Sensors.Motion.IC4001
Meadow.Peripherals.Sensors.ISensorMeadow.Hardware.II2cPeripheral