Remarks

Mcp9600
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Temperature.Mcp960x

Code Example

Mcp9600 sensor;

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

    sensor = new Mcp9600(Device.CreateI2cBus());

    var consumer = Mcp9600.CreateObserver(
        handler: result =>
        {
            Resolver.Log.Info($"Temperature New Value {result.New.TemperatureHot.Value.Celsius}C");
        },
        filter: null
    );
    sensor.Subscribe(consumer);

    sensor.Updated += Sensor_Updated;
    return Task.CompletedTask;
}

private void Sensor_Updated(object sender, IChangeResult<(Meadow.Units.Temperature? TemperatureHot, Meadow.Units.Temperature? TemperatureCold)> e)
{
    Resolver.Log.Info($"Temperature hot: {e.New.TemperatureHot.Value.Celsius:n2}C, Temperature cold: {e.New.TemperatureCold.Value.Celsius:n2}C");
}

public override Task Run()
{
    sensor.StartUpdating();
    return Task.CompletedTask;
}

Sample project(s) available on GitHub

Characteristic Locus
Inheritance object ObservableBase<(Temperature? TemperatureHot, Temperature? TemperatureCold)> SamplingSensorBase<(Temperature? TemperatureHot, Temperature? TemperatureCold)> PollingSensorBase<(Temperature? TemperatureHot, Temperature? TemperatureCold)> ByteCommsSensorBase<(Temperature? TemperatureHot, Temperature? TemperatureCold)> Mcp960x > Mcp9600
Implements IObservable<IChangeResult<(Temperature? TemperatureHot, Temperature? TemperatureCold)>> ISamplingSensor<(Temperature? TemperatureHot, Temperature? TemperatureCold)> ISensor<(Temperature? TemperatureHot, Temperature? TemperatureCold)> IDisposable ITemperatureSensor ISamplingSensor<Temperature> ISensor<Temperature> II2cPeripheral
Inherited Members Mcp960x.DefaultI2cAddress Mcp960x.TemperatureUpdated Mcp960x.TemperatureHotUpdated Mcp960x.TemperatureColdUpdated Mcp960x.Temperature Mcp960x.TemperatureHot Mcp960x.TemperatureCold Mcp960x.ReadSensor() Mcp960x.SetThermocoupleType(Mcp960x.ThermocoupleType) Mcp960x.GetThermocoupleType() Mcp960x.SetAdcResolution(Mcp960x.AdcResolution) Mcp960x.GetAdcResolution() Mcp960x.SetFilterCoefficient(Mcp960x.FilterCoefficient) Mcp960x.GetFilterCoefficient() Mcp960x.SetAlertTemperature(Mcp960x.AlertNumber, Temperature) Mcp960x.GetAlertTemperature(Mcp960x.AlertNumber) Mcp960x.ConfigureAlert(Mcp960x.AlertNumber, bool, bool, bool, bool, bool) Mcp960x.Enable(bool) Mcp960x.IsEnabled() Mcp960x.RaiseEventsAndNotify(IChangeResult<(Temperature? TemperatureHot, Temperature? TemperatureCold)>) ByteCommsSensorBase<(Temperature? TemperatureHot, Temperature? TemperatureCold)>.Init(int, int) ByteCommsSensorBase<(Temperature? TemperatureHot, Temperature? TemperatureCold)>.Dispose(bool) ByteCommsSensorBase<(Temperature? TemperatureHot, Temperature? TemperatureCold)>.Dispose() ByteCommsSensorBase<(Temperature? TemperatureHot, Temperature? TemperatureCold)>.BusComms ByteCommsSensorBase<(Temperature? TemperatureHot, Temperature? TemperatureCold)>.ReadBuffer ByteCommsSensorBase<(Temperature? TemperatureHot, Temperature? TemperatureCold)>.WriteBuffer PollingSensorBase<(Temperature? TemperatureHot, Temperature? TemperatureCold)>.StartUpdating(TimeSpan?) PollingSensorBase<(Temperature? TemperatureHot, Temperature? TemperatureCold)>.StopUpdating() SamplingSensorBase<(Temperature? TemperatureHot, Temperature? TemperatureCold)>.samplingLock SamplingSensorBase<(Temperature? TemperatureHot, Temperature? TemperatureCold)>.ReadSensor() SamplingSensorBase<(Temperature? TemperatureHot, Temperature? TemperatureCold)>.RaiseEventsAndNotify(IChangeResult<(Temperature? TemperatureHot, Temperature? TemperatureCold)>) SamplingSensorBase<(Temperature? TemperatureHot, Temperature? TemperatureCold)>.Read() SamplingSensorBase<(Temperature? TemperatureHot, Temperature? TemperatureCold)>.SamplingTokenSource SamplingSensorBase<(Temperature? TemperatureHot, Temperature? TemperatureCold)>.Conditions SamplingSensorBase<(Temperature? TemperatureHot, Temperature? TemperatureCold)>.IsSampling SamplingSensorBase<(Temperature? TemperatureHot, Temperature? TemperatureCold)>.UpdateInterval SamplingSensorBase<(Temperature? TemperatureHot, Temperature? TemperatureCold)>.Updated ObservableBase<(Temperature? TemperatureHot, Temperature? TemperatureCold)>.NotifyObservers(IChangeResult<(Temperature? TemperatureHot, Temperature? TemperatureCold)>) ObservableBase<(Temperature? TemperatureHot, Temperature? TemperatureCold)>.Subscribe(IObserver<IChangeResult<(Temperature? TemperatureHot, Temperature? TemperatureCold)>>) ObservableBase<(Temperature? TemperatureHot, Temperature? TemperatureCold)>.CreateObserver(Action<IChangeResult<(Temperature? TemperatureHot, Temperature? TemperatureCold)>>, Predicate<IChangeResult<(Temperature? TemperatureHot, Temperature? TemperatureCold)>>) ObservableBase<(Temperature? TemperatureHot, Temperature? TemperatureCold)>.observers object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString()
Namespace Meadow.Foundation.Sensors.Temperature
Assembly Mcp960x.dll

Syntax

public class Mcp9600 : Mcp960x, IObservable<IChangeResult<(Temperature? TemperatureHot, Temperature? TemperatureCold)>>, ISamplingSensor<(Temperature? TemperatureHot, Temperature? TemperatureCold)>, ISensor<(Temperature? TemperatureHot, Temperature? TemperatureCold)>, IDisposable, ITemperatureSensor, ISamplingSensor<Temperature>, ISensor<Temperature>, II2cPeripheral

Constructors

Mcp9600(II2cBus, byte)

Create a new Mcp9600 object using the default configuration for the sensor

Declaration
public Mcp9600(II2cBus i2cBus, byte address = 103)

Parameters

Type Name Description
II2cBus i2cBus

The I2C bus

byte address

I2C address of the sensor

Remarks

Mcp9600
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Temperature.Mcp960x

Code Example

Mcp9600 sensor;

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

    sensor = new Mcp9600(Device.CreateI2cBus());

    var consumer = Mcp9600.CreateObserver(
        handler: result =>
        {
            Resolver.Log.Info($"Temperature New Value {result.New.TemperatureHot.Value.Celsius}C");
        },
        filter: null
    );
    sensor.Subscribe(consumer);

    sensor.Updated += Sensor_Updated;
    return Task.CompletedTask;
}

private void Sensor_Updated(object sender, IChangeResult<(Meadow.Units.Temperature? TemperatureHot, Meadow.Units.Temperature? TemperatureCold)> e)
{
    Resolver.Log.Info($"Temperature hot: {e.New.TemperatureHot.Value.Celsius:n2}C, Temperature cold: {e.New.TemperatureCold.Value.Celsius:n2}C");
}

public override Task Run()
{
    sensor.StartUpdating();
    return Task.CompletedTask;
}

Sample project(s) available on GitHub