Skip to main content

Meadow.Foundation.Sensors.Environmental.Y4000

Y4000
StatusStatus badge: working
Source codeGitHub
Datasheet(s)GitHub
NuGet packageNuGet 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