Meadow.Foundation.ADCs.Mcp3xxx
1.3.2-beta
Meadow.Foundation.ICs.ADCs.Mcp3xxx
Additional DetailsDriver re-published under a correct namespace.
dotnet add package Meadow.Foundation.ADCs.Mcp3xxx --version 1.3.2-beta
NuGet\Install-Package Meadow.Foundation.ADCs.Mcp3xxx -Version 1.3.2-beta
<PackageReference Include="Meadow.Foundation.ADCs.Mcp3xxx" Version="1.3.2-beta" />
paket add Meadow.Foundation.ADCs.Mcp3xxx --version 1.3.2-beta
#r "nuget: Meadow.Foundation.ADCs.Mcp3xxx, 1.3.2-beta"
// Install Meadow.Foundation.ADCs.Mcp3xxx as a Cake Addin
#addin nuget:?package=Meadow.Foundation.ADCs.Mcp3xxx&version=1.3.2-beta&prerelease
// Install Meadow.Foundation.ADCs.Mcp3xxx as a Cake Tool
#tool nuget:?package=Meadow.Foundation.ADCs.Mcp3xxx&version=1.3.2-beta&prerelease
Meadow.Foundation.ADCs.Mcp3xxx
Mcp3xxx SPI analog-to-digital converter (MCP3001, MCP3002, MCP3004, MCP3008, MCP3201, MCP3202, MCP3204, MCP3208)
The Mcp3xxx library is designed for the Wilderness Labs Meadow .NET IoT platform and is part of Meadow.Foundation
The Meadow.Foundation peripherals library is an open-source repository of drivers and libraries that streamline and simplify adding hardware to your C# .NET Meadow IoT application.
For more information on developing for Meadow, visit developer.wildernesslabs.co, to view all Wilderness Labs open-source projects, including samples, visit github.com/wildernesslabs
Usage
Mcp3001 mcp;
IAnalogInputPort port;
public override Task Initialize()
{
Resolver.Log.Info("Initialize");
IDigitalOutputPort chipSelectPort = Device.CreateDigitalOutputPort(Device.Pins.D01);
mcp = new Mcp3001(Device.CreateSpiBus(), chipSelectPort);
port = mcp.CreateAnalogInputPort();
port.Updated += (s, result) =>
{
Console.WriteLine($"Analog event, new voltage: {result.New.Volts:N2}V, old: {result.Old?.Volts:N2}V");
};
var observer = IAnalogInputPort.CreateObserver(
handler: result =>
{
Resolver.Log.Info($"Analog observer triggered; new: {result.New.Volts:n2}V, old: {result.Old?.Volts:n2}V");
},
filter: result =>
{
if (result.Old is { } oldValue)
{
return (result.New - oldValue).Abs().Volts > 0.1;
}
else { return false; }
}
);
port.Subscribe(observer);
return base.Initialize();
}
public override Task Run()
{
Resolver.Log.Info("Run");
port.StartUpdating();
return Task.CompletedTask;
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Meadow.Foundation (>= 1.3.2-beta)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|