Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

Characteristic Locus
Inheritance object ObservableBase<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)> SamplingSensorBase<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)> PollingSensorBase<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)> > Y4000
Implements IObservable<IChangeResult<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>> ISamplingSensor<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)> ISensor<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)> IDisposable
Inherited Members PollingSensorBase<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>.StartUpdating(TimeSpan?) PollingSensorBase<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>.StopUpdating() SamplingSensorBase<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>.samplingLock SamplingSensorBase<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>.Updated SamplingSensorBase<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>.SamplingTokenSource SamplingSensorBase<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>.Conditions SamplingSensorBase<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>.IsSampling SamplingSensorBase<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>.UpdateInterval SamplingSensorBase<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>.ReadSensor() SamplingSensorBase<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>.RaiseEventsAndNotify(IChangeResult<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>) SamplingSensorBase<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>.Read() ObservableBase<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>.observers ObservableBase<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>.NotifyObservers(IChangeResult<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>) ObservableBase<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>.Subscribe(IObserver<IChangeResult<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>>) ObservableBase<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>.CreateObserver(Action<IChangeResult<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>>, Predicate<IChangeResult<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>>) object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString()
Namespace Meadow.Foundation.Sensors.Environmental
Assembly Y4000.dll

Syntax

public class Y4000 : PollingSensorBase<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>, IObservable<IChangeResult<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>>, ISamplingSensor<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>, ISensor<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>, IDisposable

Constructors

Y4000(IMeadowDevice, SerialPortName, byte, IPin?)

Creates a new Y4000 object

Declaration
public Y4000(IMeadowDevice device, SerialPortName serialPortName, byte modbusAddress = 1, IPin? enablePin = null)

Parameters

Type Name Description
IMeadowDevice device
SerialPortName serialPortName
byte modbusAddress
IPin enablePin

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

Y4000(IModbusBusClient, byte)

Creates a new Y4000 object

Declaration
public Y4000(IModbusBusClient modbusClient, byte modbusAddress = 1)

Parameters

Type Name Description
IModbusBusClient modbusClient
byte modbusAddress

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

Properties

BlueGreenAlgae

The current Blue Green Algae concentration

Declaration
public ConcentrationInWater? BlueGreenAlgae { get; }

Property Value

Type Description
ConcentrationInWater?

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

Chlorophyl

The current Chlorophyll concentration

Declaration
public ConcentrationInWater? Chlorophyl { get; }

Property Value

Type Description
ConcentrationInWater?

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

DissolvedOxygen

The current Dissolved Oxygen concentration

Declaration
public ConcentrationInWater? DissolvedOxygen { get; }

Property Value

Type Description
ConcentrationInWater?

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

ElectricalConductivity

The current Electrical Conductivity

Declaration
public Conductivity? ElectricalConductivity { get; }

Property Value

Type Description
Conductivity?

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

IsDisposed

Is the object disposed

Declaration
public bool IsDisposed { get; }

Property Value

Type Description
bool

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

ModbusAddress

The current modbus address

Declaration
public byte ModbusAddress { get; }

Property Value

Type Description
byte

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

OxidationReductionPotential

The current Oxidation Reduction Potential (redux)

Declaration
public Voltage? OxidationReductionPotential { get; }

Property Value

Type Description
Voltage?

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

PH

The current Potential Hydrogen (pH)

Declaration
public PotentialHydrogen? PH { get; }

Property Value

Type Description
PotentialHydrogen?

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

Turbidity

The current Turbidity

Declaration
public Turbidity? Turbidity { get; }

Property Value

Type Description
Turbidity?

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

Dispose(bool)

Dispose of the object

Declaration
protected virtual void Dispose(bool disposing)

Parameters

Type Name Description
bool disposing

Is disposing

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

GetBrushInterval()

Get the brush or wiper interval

Declaration
public Task<TimeSpan> GetBrushInterval()

Returns

Type Description
Task<TimeSpan>

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

GetErrorFlag()

Read the error flag from the sensor

Declaration
public Task<ushort> GetErrorFlag()

Returns

Type Description
Task<ushort>

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

GetISDN()

Get the device ISDN (address) of the sensor Note this is a broadcast event so all Y4000 devices on the bus will respond

Declaration
public Task<byte> GetISDN()

Returns

Type Description
Task<byte>

The address as a byte

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

GetSerialNumber()

Get the device serial number

Declaration
public Task<ushort[]> GetSerialNumber()

Returns

Type Description
Task<ushort[]>

The serial number as a ushort array

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

GetSupplyVoltage()

Get the current supply voltage

Declaration
public Task<Voltage> GetSupplyVoltage()

Returns

Type Description
Task<Voltage>

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

GetVersion()

Get the device version

Declaration
public Task<ushort[]> GetVersion()

Returns

Type Description
Task<ushort[]>

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

Initialize()

Initialize sensor

Declaration
public Task Initialize()

Returns

Type Description
Task

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

RaiseEventsAndNotify(IChangeResult<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>)

Raise events for subscribers and notify of value changes

Declaration
protected override void RaiseEventsAndNotify(IChangeResult<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)> changeResult)

Parameters

Type Name Description
IChangeResult<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)> changeResult

The updated sensor data

Overrides

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

ReadSensor()

Reads data from the sensor

Declaration
protected override Task<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)> ReadSensor()

Returns

Type Description
Task<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>

The latest sensor reading

Overrides

Meadow.Foundation.SamplingSensorBase<(Meadow.Units.ConcentrationInWater? DissolvedOxygen, Meadow.Units.ConcentrationInWater? Chlorophyl, Meadow.Units.ConcentrationInWater? BlueGreenAlgae, Meadow.Units.Conductivity? ElectricalConductivity, Meadow.Units.PotentialHydrogen? PH, Meadow.Units.Turbidity? Turbidity, Meadow.Units.Temperature? Temperature, Meadow.Units.Voltage? OxidationReductionPotential)>.ReadSensor()

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

SetBrushInterval(TimeSpan)

Set the brush or wiper interval (normalized to minutes)

Declaration
public Task SetBrushInterval(TimeSpan interval)

Parameters

Type Name Description
TimeSpan interval

Returns

Type Description
Task

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

SetISDN(byte)

Set the ISDN (address) of the sensor

Declaration
public Task SetISDN(byte modbusAddress)

Parameters

Type Name Description
byte modbusAddress

The address

Returns

Type Description
Task

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

StartBrush()

Start the brush or wiper

Declaration
public Task StartBrush()

Returns

Type Description
Task

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

Events

BlueGreenAlgaeUpdated

Raised when the BlueGreenAlgae value changes

Declaration
public event EventHandler<IChangeResult<ConcentrationInWater>> BlueGreenAlgaeUpdated

Event Type

Type Description
EventHandler<IChangeResult<ConcentrationInWater>>

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

ChlorophylUpdated

Raised when the Chlorophyll value changes

Declaration
public event EventHandler<IChangeResult<ConcentrationInWater>> ChlorophylUpdated

Event Type

Type Description
EventHandler<IChangeResult<ConcentrationInWater>>

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

DissolvedOxygenUpdated

Raised when the DissolvedOxygen value changes

Declaration
public event EventHandler<IChangeResult<ConcentrationInWater>> DissolvedOxygenUpdated

Event Type

Type Description
EventHandler<IChangeResult<ConcentrationInWater>>

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

ElectricalConductivityUpdated

Raised when the ElectricalConductivity value changes

Declaration
public event EventHandler<IChangeResult<Conductivity>> ElectricalConductivityUpdated

Event Type

Type Description
EventHandler<IChangeResult<Conductivity>>

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

OxidationReductionPotentialUpdated

Raised when the OxidationReductionPotential (redux) value changes

Declaration
public event EventHandler<IChangeResult<Voltage>> OxidationReductionPotentialUpdated

Event Type

Type Description
EventHandler<IChangeResult<Voltage>>

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

PHUpdated

Raised when the PotentialHydrogen (pH) value changes

Declaration
public event EventHandler<IChangeResult<PotentialHydrogen>> PHUpdated

Event Type

Type Description
EventHandler<IChangeResult<PotentialHydrogen>>

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

TemperatureUpdated

Raised when the Temperature value changes

Declaration
public event EventHandler<IChangeResult<Temperature>> TemperatureUpdated

Event Type

Type Description
EventHandler<IChangeResult<Temperature>>

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub

TurbidityUpdated

Raised when the Turbidity value changes

Declaration
public event EventHandler<IChangeResult<Turbidity>> TurbidityUpdated

Event Type

Type Description
EventHandler<IChangeResult<Turbidity>>

Remarks

Y4000
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Environmental.Y4000

Code Example

Y4000 sensor;

public async override Task Initialize()
{
    Resolver.Log.Info("Initialize...");
    await Task.Delay(2000);

    sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
    await sensor.Initialize();

    await Task.Delay(2000);
}

public override async Task Run()
{
    Resolver.Log.Info("Run...");

    var isdn = await sensor.GetISDN();
    Resolver.Log.Info($"Address: {isdn}");

    var supplyVoltage = await sensor.GetSupplyVoltage();
    Resolver.Log.Info($"Supply voltage: {supplyVoltage}");

    var measurements = await sensor.Read();

    Resolver.Log.Info($"Sensor data: {measurements}");
}

Sample project(s) available on GitHub