Skip to main content

Meadow.Foundation.Sensors.Temperature.Pct2075

Pct2075
StatusStatus badge: working
Source codeGitHub
Datasheet(s)GitHub
NuGet packageNuGet Gallery for Meadow.Foundation.Sensors.Temperature.Pct2075

Code Example

private Pct2075 sensor;

public override Task Initialize()
{
sensor = new Pct2075(Device.CreateI2cBus());

sensor.Updated += OnUpdated;

return Task.CompletedTask;
}

public override Task Run()
{
sensor.StartUpdating(TimeSpan.FromSeconds(1));

return Task.CompletedTask;
}

private void OnUpdated(object sender, IChangeResult<Meadow.Units.Temperature> e)
{
Resolver.Log.Info($"Temp: {e.New.Celsius:n1}C {e.New.Fahrenheit:n1}F");
}

Sample project(s) available on GitHub