Remarks
VibrationSensor | |
---|---|
Status | |
Source code | GitHub |
NuGet package |
Code Example
VibrationSensor sensor;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
sensor = new VibrationSensor(Device.Pins.D13);
sensor.VibrationDetected += (s, e) =>
{
Resolver.Log.Info("Motion detected");
};
return Task.CompletedTask;
}
Sample project(s) available on GitHub
Wiring Example
VibrationSensor | Meadow Pin |
---|---|
GND | GND |
VCC | 3.3V |
RX | D01 |
TX | D00 |
Characteristic | Locus |
---|---|
Inheritance | object > VibrationSensor |
Inherited Members | object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() |
Namespace | Meadow.Foundation.Grove.Sensors.Motion |
Assembly | VibrationSensor.dll |
Syntax
public class VibrationSensor
Constructors
VibrationSensor(IDigitalInterruptPort)
Creates a VibrationSensor driver
Declaration
public VibrationSensor(IDigitalInterruptPort signalPort)
Parameters
Type | Name | Description |
---|---|---|
IDigitalInterruptPort | signalPort |
Remarks
VibrationSensor | |
---|---|
Status | |
Source code | GitHub |
NuGet package |
Code Example
VibrationSensor sensor;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
sensor = new VibrationSensor(Device.Pins.D13);
sensor.VibrationDetected += (s, e) =>
{
Resolver.Log.Info("Motion detected");
};
return Task.CompletedTask;
}
Sample project(s) available on GitHub
Wiring Example
VibrationSensor | Meadow Pin |
---|---|
GND | GND |
VCC | 3.3V |
RX | D01 |
TX | D00 |
VibrationSensor(IPin)
Creates a VibrationSensor driver
Declaration
public VibrationSensor(IPin inputPin)
Parameters
Type | Name | Description |
---|---|---|
IPin | inputPin |
Remarks
VibrationSensor | |
---|---|
Status | |
Source code | GitHub |
NuGet package |
Code Example
VibrationSensor sensor;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
sensor = new VibrationSensor(Device.Pins.D13);
sensor.VibrationDetected += (s, e) =>
{
Resolver.Log.Info("Motion detected");
};
return Task.CompletedTask;
}
Sample project(s) available on GitHub
Wiring Example
VibrationSensor | Meadow Pin |
---|---|
GND | GND |
VCC | 3.3V |
RX | D01 |
TX | D00 |
Events
VibrationDetected
Event triggered when vibration is detected
Declaration
public event EventHandler VibrationDetected
Event Type
Type | Description |
---|---|
EventHandler |
Remarks
VibrationSensor | |
---|---|
Status | |
Source code | GitHub |
NuGet package |
Code Example
VibrationSensor sensor;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
sensor = new VibrationSensor(Device.Pins.D13);
sensor.VibrationDetected += (s, e) =>
{
Resolver.Log.Info("Motion detected");
};
return Task.CompletedTask;
}
Sample project(s) available on GitHub
Wiring Example
VibrationSensor | Meadow Pin |
---|---|
GND | GND |
VCC | 3.3V |
RX | D01 |
TX | D00 |