nanoFramework.Iot.Device.Max1704x
1.0.71
Prefix Reserved
dotnet add package nanoFramework.Iot.Device.Max1704x --version 1.0.71
NuGet\Install-Package nanoFramework.Iot.Device.Max1704x -Version 1.0.71
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="nanoFramework.Iot.Device.Max1704x" Version="1.0.71" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add nanoFramework.Iot.Device.Max1704x --version 1.0.71
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: nanoFramework.Iot.Device.Max1704x, 1.0.71"
#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 nanoFramework.Iot.Device.Max1704x as a Cake Addin
#addin nuget:?package=nanoFramework.Iot.Device.Max1704x&version=1.0.71
// Install nanoFramework.Iot.Device.Max1704x as a Cake Tool
#tool nuget:?package=nanoFramework.Iot.Device.Max1704x&version=1.0.71
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
MAX1704x/MAX17043/MAX17044/MAX17048/MAX17049 - Battery gauge
Library designed for controlling MAX1704x IC.
Functions
The binding supports all functionalities for MAX1704x family. Implemented based on SparkFun implementation.
Classes
- Max17043 - class for MAX17043
- Max17044 - class for MAX17044
- Max17048 - class for MAX17048
- Max17049 - class for MAX17049
- Max1704x - base class for all max IC
Usage
// Make sure your pins are configured correctly especially for ESp32
var i2cDevice = I2cDevice.Create(new I2cConnectionSettings(1, Max1704X.DefaultAddress));
var max = new Max17048(i2cDevice);
Console.WriteLine($"Voltage: {max.BatteryVoltage.Volts} V");
Console.WriteLine($"Percent: {max.BatteryPercent.Percent} %");
Important: make sure you properly setup the I2C pins especially for ESP32 before creating the I2cDevice
.
//////////////////////////////////////////////////////////////////////
// when connecting to an ESP32 device, need to configure the I2C GPIOs
// used for the bus
Configuration.SetPinFunction(21, DeviceFunction.I2C1_DATA);
Configuration.SetPinFunction(22, DeviceFunction.I2C1_CLOCK);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
- nanoFramework.CoreLibrary (>= 1.15.5)
- nanoFramework.System.Device.I2c (>= 1.1.16)
- UnitsNet.nanoFramework.ElectricPotential (>= 5.50.0)
- UnitsNet.nanoFramework.Ratio (>= 5.50.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.