nanoFramework.Iot.Device.Am2320 1.2.573

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package nanoFramework.Iot.Device.Am2320 --version 1.2.573
NuGet\Install-Package nanoFramework.Iot.Device.Am2320 -Version 1.2.573
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.Am2320" Version="1.2.573" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add nanoFramework.Iot.Device.Am2320 --version 1.2.573
#r "nuget: nanoFramework.Iot.Device.Am2320, 1.2.573"
#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.Am2320 as a Cake Addin
#addin nuget:?package=nanoFramework.Iot.Device.Am2320&version=1.2.573

// Install nanoFramework.Iot.Device.Am2320 as a Cake Tool
#tool nuget:?package=nanoFramework.Iot.Device.Am2320&version=1.2.573

AM2320 - Temperature and Humidity sensor

AM2320 is a temperature and humidity sensor, sensible to 0.1 degree and 0.1 relative humidity.

Documentation

Usage

Important: make sure you properly setup the I2C pins especially for ESP32 before creating the I2cDevice, make sure you install the nanoFramework.Hardware.ESP32 nuget:

//////////////////////////////////////////////////////////////////////
// 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);

For other devices like STM32, please make sure you're using the pre-set pins for the SPI bus you want to use. The chip select can as well be pre setup.

Here is an example how to use the AM2320:

using Iot.Device.Am2320;
using nanoFramework.Hardware.Esp32;
using System.Device.I2c;
using System.Diagnostics;
using System.Threading;

Debug.WriteLine("Hello from AM2320!");

//////////////////////////////////////////////////////////////////////
// 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);

using Am2320 am2330 = new(new I2cDevice(new I2cConnectionSettings(1, Am2320.DefaultI2cAddress, I2cBusSpeed.StandardMode)));

while(true)
{
    var temp = am2330.Temperature;
    var hum = am2330.Humidity;
    if(am2330.IsLastReadSuccessful)
    {
        Debug.WriteLine($"Temp = {temp.DegreesCelsius} C, Hum = {hum.Percent} %");
    }
    else
    {
        Debug.WriteLine("Not sucessfull read");
    }

    Thread.Sleep(Am2320.MinimumReadPeriod);
}

Device Information

You can read the Device Information.

Note: on some copies, the device information only returns 0.

// On some copies, the device information contains only 0
var deviceInfo = am2330.DeviceInformation;
if (deviceInfo != null)
{
    Debug.WriteLine($"Model: {deviceInfo.Model}");
    Debug.WriteLine($"Version: {deviceInfo.Version}");
    Debug.WriteLine($"Device ID: {deviceInfo.DeviceId}");
}

Limitations

Only the I2C implementation is available, not the 1 wire one.

The user registers and the status register are not implemented. The status register is just a register the user can store data. It is not currently used for any usage according to the documentation.

Product 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.

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
1.2.573 77 6/19/2024
1.2.570 68 6/14/2024
1.2.536 98 4/15/2024
1.2.514 91 3/22/2024
1.2.494 92 2/28/2024
1.2.474 104 1/24/2024
1.2.462 125 1/5/2024
1.2.458 110 12/20/2023
1.2.436 152 11/10/2023
1.2.416 99 11/8/2023
1.2.403 120 10/6/2023
1.2.396 123 9/27/2023
1.2.384 126 9/6/2023
1.2.378 120 8/16/2023
1.2.369 142 8/2/2023
1.2.363 128 7/28/2023
1.2.357 136 7/19/2023
1.2.354 135 7/14/2023
1.2.345 142 6/21/2023
1.2.341 147 6/14/2023
1.2.337 157 6/7/2023
1.2.335 155 6/2/2023
1.2.329 152 5/26/2023
1.2.313 156 5/12/2023
1.2.302 155 5/10/2023
1.2.297 160 5/3/2023
1.2.273 250 3/17/2023
1.2.267 253 3/10/2023
1.2.263 251 3/8/2023
1.2.259 270 2/27/2023
1.2.256 247 2/24/2023
1.2.253 256 2/22/2023
1.2.222 306 1/9/2023
1.2.217 321 1/6/2023
1.2.212 297 1/5/2023
1.2.208 308 1/3/2023
1.2.203 315 12/28/2022
1.2.159 378 11/14/2022
1.2.153 392 11/5/2022
1.2.141 415 10/25/2022
1.2.87 494 9/15/2022
1.2.63 411 9/3/2022
1.2.47 419 8/15/2022
1.2.40 434 8/6/2022
1.2.38 415 8/5/2022
1.2.28 403 8/1/2022
1.2.13 414 7/24/2022
1.2.10 401 7/23/2022
1.1.145.58726 446 7/7/2022
1.1.133.52556 426 6/30/2022
1.1.121.35854 457 6/26/2022
1.1.116.8772 426 6/24/2022
1.1.113.2032 418 6/23/2022
1.1.102.51394 411 6/15/2022
1.1.99.36719 423 6/14/2022
1.1.97.17326 441 6/13/2022
1.1.92.53000 440 6/8/2022
1.1.72.29765 432 5/31/2022
1.1.64.21380 439 5/26/2022
1.1.54.28879 431 5/23/2022
1.1.40 440 5/5/2022
1.1.3 467 4/15/2022
1.1.1 426 4/14/2022
1.0.300 440 3/31/2022
1.0.288-preview.82 121 3/25/2022
1.0.288-preview.81 108 3/25/2022
1.0.288-preview.72 100 3/22/2022
1.0.288-preview.71 104 3/21/2022
1.0.288-preview.68 111 3/19/2022
1.0.288-preview.67 111 3/18/2022
1.0.288-preview.66 107 3/18/2022
1.0.288-preview.61 108 3/15/2022
1.0.288-preview.54 117 3/8/2022
1.0.288-preview.45 116 2/27/2022
1.0.288-preview.43 106 2/26/2022
1.0.288-preview.33 110 2/18/2022
1.0.288-preview.31 108 2/16/2022
1.0.288-preview.29 122 2/12/2022
1.0.288-preview.26 115 2/10/2022
1.0.288-preview.21 110 2/9/2022
1.0.288-preview.1 127 1/30/2022