MassaK.Plugin 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package MassaK.Plugin --version 1.0.1                
NuGet\Install-Package MassaK.Plugin -Version 1.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MassaK.Plugin" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MassaK.Plugin --version 1.0.1                
#r "nuget: MassaK.Plugin, 1.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MassaK.Plugin as a Cake Addin
#addin nuget:?package=MassaK.Plugin&version=1.0.1

// Install MassaK.Plugin as a Cake Tool
#tool nuget:?package=MassaK.Plugin&version=1.0.1                

Usage

Setup MassaK

This code creates MassaK Instance without connecting. It is recommended to subscribe to OnStatusChanged and OnWeightChanged before using method Connect()

using MassaK.Plugin
using MassaK.Plugin.Imp;

IMassaK MassaK = new MassaUsb("COM6");
MassaK.OnStatusChanged += ReceiveStatus;
MassaK.OnWeightChanged += ReceiveWeight;

Connect

This method is safely for use, no exceptions only event StatusChanged.

MassaK.Connect();

Get weight

This method requests weight data from the scales. The argument specifies the interval in milliseconds between requests. A smaller value means faster polling, with a minimum of 100 milliseconds (use cautiously). Use OnWeightChanged event

MassaK.StartWeightPolling(100);

Calibrate

Ensure there is no weight placed on the scales before connecting them via USB. If any issues arise, reconnect the scales via USB.

MassaK.Сalibrate();

Disconnect

MassaK.Disconnect();

After calling Disconnect, you can reconnect the object again that's why you need to call Dispose() for full destroy. Or call only Dispose() without Disconnect()

MassaK.Dispose();
Product Compatible and additional computed target framework versions.
.NET net8.0-windows10.0.19041 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.