Skip to main content

Meadow.Foundation.mikroBUS.Sensors.C420R

C420R
StatusStatus badge: working
Source codeGitHub
NuGet packageNuGet Gallery for Meadow.Foundation.mikroBUS.Sensors.C420R

Code Example

private C420R receiver;

public override Task Initialize()
{
Console.WriteLine("Initializing ...");

receiver = new C420R(Device.CreateSpiBus(), Device.Pins.D00);

return Task.CompletedTask;
}

public override async Task Run()
{
while (true)
{
var r = await receiver.Read();
Resolver.Log.Info($"Reading: {r.Milliamps:0.00} mA");
await Task.Delay(1000);
}
}

Sample project(s) available on GitHub

Class C420R

Represents a mikroBUS 4-20mA receiver Click board

Assembly: C420R.dll
View Source
Declaration
public class C420R : PollingSensorBase<Current>, IObservable<IChangeResult<Current>>, ISamplingSensor<Current>, ISensor<Current>, ISensor, ISamplingSensor

Inheritance: System.Object -> Meadow.Foundation.ObservableBase<Meadow.Units.Current> -> Meadow.Foundation.SamplingSensorBase<Meadow.Units.Current> -> Meadow.Foundation.PollingSensorBase<Meadow.Units.Current>

Implements:
System.IObservable<Meadow.IChangeResult<Meadow.Units.Current>>, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Current>, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Current>, Meadow.Peripherals.Sensors.ISensor, Meadow.Peripherals.Sensors.ISamplingSensor

Properties

ReferenceVoltage

Reference voltage (2.048V)

View Source
Declaration
public Voltage ReferenceVoltage { get; protected set; }

Methods

ReadSensor()

Read value from sensor

View Source
Declaration
protected override Task<Current> ReadSensor()
Returns

System.Threading.Tasks.Task<Meadow.Units.Current>: unitized value

Implements

  • System.IObservable<Meadow.IChangeResult<Meadow.Units.Current>>
  • Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Current>
  • Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Current>
  • Meadow.Peripherals.Sensors.ISensor
  • Meadow.Peripherals.Sensors.ISamplingSensor