nanoFramework.Iot.Device.Si7021 1.3.613
前缀已保留
dotnet add package nanoFramework.Iot.Device.Si7021 --version 1.3.613
NuGet\Install-Package nanoFramework.Iot.Device.Si7021 -Version 1.3.613
此命令旨在在 Visual Studio 的包管理器控制台中使用,因为它使用了 NuGet 模块的 Install-Package 版本。
<PackageReference Include="nanoFramework.Iot.Device.Si7021" Version="1.3.613" />
对于支持 PackageReference 的项目,将此 XML 节点复制到项目文件中以引用该包。
paket add nanoFramework.Iot.Device.Si7021 --version 1.3.613
NuGet 团队不提供对此客户端的支持。请联系其 管理员 以获取支持。
#r "nuget: nanoFramework.Iot.Device.Si7021, 1.3.613"
#r 指令可用于 F# Interactive 和 Polyglot Notebooks。将此内容复制到交互式工具或脚本的源代码中,以引用包。
// Install nanoFramework.Iot.Device.Si7021 as a Cake Addin #addin nuget:?package=nanoFramework.Iot.Device.Si7021&version=1.3.613 // Install nanoFramework.Iot.Device.Si7021 as a Cake Tool #tool nuget:?package=nanoFramework.Iot.Device.Si7021&version=1.3.613
NuGet 团队不提供对此客户端的支持。请联系其 管理员 以获取支持。
Si7021 - 温湿度传感器
Si7021 设备提供温度和湿度传感器的读数,通过 I2C 接口。
文档
- Si7021 数据表
主板
使用方法
重要:在创建 I2cDevice
之前,务必正确设置 I2C 引脚,特别是 ESP32 的 I2C 引脚,确保安装了 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);
对于类似 STM32 的其他设备,请确保您使用的是您想要使用的 I2C 总线预设引脚。
硬件需求
- Si7021
- 公/母跳接线
电路
- SCL - SCL
- SDA - SDA
- VCC - 5V
- GND - GND
代码
I2cConnectionSettings settings = new I2cConnectionSettings(1, Si7021.DefaultI2cAddress);
I2cDevice device = I2cDevice.Create(settings);
using (Si7021 sensor = new Si7021(device, Resolution.Resolution1))
{
while (true)
{
var tempValue = sensor.Temperature;
var humValue = sensor.Humidity;
Debug.WriteLine($"Temperature: {tempValue.Celsius:N2}\u00B0C");
Debug.WriteLine($"Relative humidity: {humValue:N2}%");
// WeatherHelper supports more calculations, such as saturated vapor pressure, actual vapor pressure and absolute humidity.
Debug.WriteLine($"Heat index: {WeatherHelper.CalculateHeatIndex(tempValue, humValue).Celsius:N2}\u00B0C");
Debug.WriteLine($"Dew point: {WeatherHelper.CalculateDewPoint(tempValue, humValue).Celsius:N2}\u00B0C");
Debug.WriteLine();
Thread.Sleep(1000);
}
}
结果
产品 | 版本 兼容和额外的计算目标框架版本。 |
---|---|
.NET Framework | net兼容。 |
-
- nanoFramework.CoreLibrary (>= 1.15.5)
- nanoFramework.System.Buffers.Binary.BinaryPrimitives (>= 1.2.586)
- nanoFramework.System.Device.I2c (>= 1.1.16)
- nanoFramework.System.Device.Model (>= 1.2.586)
- nanoFramework.System.Math (>= 1.5.43)
- UnitsNet.nanoFramework.RelativeHumidity (>= 5.56.0)
- UnitsNet.nanoFramework.Temperature (>= 5.56.0)
NuGet包
此包未被任何NuGet包使用。
GitHub仓库
此包未被任何流行的GitHub仓库使用。
版本 | 下载 | 最后更新 |
---|---|---|
1.3.613 | 58 | 8/9/2024 |
1.3.601 | 48 | 7/26/2024 |
1.3.590 | 66 | 7/17/2024 |
1.3.573 | 85 | 6/19/2024 |
1.3.570 | 74 | 6/14/2024 |
1.3.536 | 94 | 4/15/2024 |
1.3.514 | 94 | 3/22/2024 |
1.3.494 | 97 | 2/28/2024 |
1.3.462 | 164 | 1/5/2024 |
1.3.458 | 102 | 12/20/2023 |
1.3.436 | 147 | 11/10/2023 |
1.3.416 | 96 | 11/8/2023 |
1.3.403 | 121 | 10/6/2023 |
1.3.396 | 103 | 9/27/2023 |
1.3.384 | 108 | 9/6/2023 |
1.3.378 | 138 | 8/16/2023 |
1.3.369 | 121 | 8/2/2023 |
1.3.363 | 127 | 7/28/2023 |
1.3.357 | 123 | 7/19/2023 |
1.3.354 | 128 | 7/14/2023 |
1.3.345 | 127 | 6/21/2023 |
1.3.341 | 122 | 6/14/2023 |
1.3.337 | 131 | 6/7/2023 |
1.3.335 | 135 | 6/2/2023 |
1.3.329 | 133 | 5/26/2023 |
1.3.313 | 150 | 5/12/2023 |
1.3.302 | 167 | 5/10/2023 |
1.3.297 | 151 | 5/3/2023 |
1.3.273 | 221 | 3/17/2023 |
1.3.267 | 213 | 3/10/2023 |
1.3.263 | 218 | 3/8/2023 |
1.3.259 | 230 | 2/27/2023 |
1.3.256 | 236 | 2/24/2023 |
1.3.253 | 240 | 2/22/2023 |
1.3.222 | 282 | 1/9/2023 |
1.3.217 | 297 | 1/6/2023 |
1.3.212 | 285 | 1/5/2023 |
1.3.208 | 289 | 1/3/2023 |
1.3.203 | 278 | 12/28/2022 |
1.3.159 | 345 | 11/14/2022 |
1.3.158 | 319 | 11/13/2022 |
1.3.153 | 355 | 11/5/2022 |
1.3.141 | 388 | 10/25/2022 |
1.3.128 | 400 | 10/22/2022 |
1.3.87 | 460 | 9/15/2022 |
1.3.63 | 395 | 9/3/2022 |
1.3.47 | 405 | 8/15/2022 |
1.3.40 | 409 | 8/6/2022 |
1.3.38 | 405 | 8/5/2022 |
1.3.28 | 404 | 8/1/2022 |
1.3.13 | 405 | 7/24/2022 |
1.3.10 | 414 | 7/23/2022 |
1.2.39.3202 | 472 | 7/7/2022 |
1.2.30.52556 | 409 | 6/30/2022 |
1.2.18.35854 | 419 | 6/26/2022 |
1.2.13.8772 | 395 | 6/24/2022 |
1.2.1.30943 | 401 | 6/15/2022 |
1.1.102.51394 | 413 | 6/15/2022 |
1.1.99.36719 | 415 | 6/14/2022 |
1.1.97.17326 | 408 | 6/13/2022 |
1.1.92.53000 | 416 | 6/8/2022 |
1.1.72.29765 | 401 | 5/31/2022 |
1.1.61.27737 | 419 | 5/25/2022 |
1.1.58.10097 | 420 | 5/23/2022 |
1.1.54.28879 | 408 | 5/23/2022 |
1.1.40 | 456 | 5/5/2022 |
1.1.11 | 448 | 4/19/2022 |
1.1.3 | 447 | 4/15/2022 |
1.1.1 | 453 | 4/14/2022 |
1.0.300 | 436 | 4/3/2022 |
1.0.288-preview.114 | 119 | 3/25/2022 |
1.0.288-preview.113 | 107 | 3/25/2022 |
1.0.288-preview.104 | 99 | 3/22/2022 |
1.0.288-preview.103 | 98 | 3/21/2022 |
1.0.288-preview.100 | 114 | 3/19/2022 |
1.0.288-preview.99 | 118 | 3/18/2022 |
1.0.288-preview.94 | 118 | 3/15/2022 |
1.0.288-preview.87 | 107 | 3/10/2022 |
1.0.288-preview.77 | 114 | 2/27/2022 |
1.0.288-preview.75 | 107 | 2/26/2022 |
1.0.288-preview.63 | 111 | 2/16/2022 |
1.0.288-preview.61 | 117 | 2/12/2022 |
1.0.288-preview.58 | 116 | 2/10/2022 |
1.0.288-preview.53 | 110 | 2/9/2022 |
1.0.288-preview.48 | 125 | 2/4/2022 |
1.0.288-preview.41 | 128 | 1/31/2022 |
1.0.288-preview.20 | 120 | 1/27/2022 |
1.0.288-preview.18 | 122 | 1/27/2022 |
1.0.288-preview.5 | 130 | 1/24/2022 |
1.0.272 | 468 | 1/10/2022 |
1.0.259 | 327 | 12/9/2021 |
1.0.258 | 298 | 12/7/2021 |
1.0.157 | 353 | 9/4/2021 |
1.0.155 | 306 | 8/31/2021 |
1.0.153 | 330 | 8/14/2021 |
1.0.151 | 334 | 8/6/2021 |
1.0.146 | 328 | 7/22/2021 |
1.0.136 | 418 | 7/17/2021 |
1.0.135 | 150 | 7/16/2021 |
1.0.134 | 166 | 7/15/2021 |
1.0.133 | 193 | 7/14/2021 |
1.0.131 | 161 | 7/8/2021 |
1.0.130 | 178 | 7/6/2021 |
1.0.129 | 153 | 7/6/2021 |
1.0.127 | 171 | 7/5/2021 |
1.0.125 | 191 | 7/5/2021 |
1.0.122 | 205 | 6/30/2021 |
1.0.121 | 193 | 6/29/2021 |
1.0.119 | 217 | 6/28/2021 |
1.0.111 | 172 | 6/14/2021 |
1.0.105 | 164 | 5/29/2021 |
1.0.104 | 233 | 5/29/2021 |
1.0.97 | 168 | 5/28/2021 |
1.0.72 | 187 | 5/26/2021 |