nanoFramework.Iot.Device.Apa102 1.2.613
前缀预留
dotnet add package nanoFramework.Iot.Device.Apa102 --version 1.2.613
NuGet\Install-Package nanoFramework.Iot.Device.Apa102 -Version 1.2.613
此命令旨在在 Visual Studio 的包管理器控制台中使用,因为它使用了 NuGet 模块的 Install-Package 版本。
<PackageReference Include="nanoFramework.Iot.Device.Apa102" Version="1.2.613" />
对于支持 包引用 的项目,将此 XML 节点复制到项目文件中,以便引用此包。
paket add nanoFramework.Iot.Device.Apa102 --version 1.2.613
NuGet 团队不提供对该客户端的支持。请联系其 维护者 以获得支持。
#r "nuget: nanoFramework.Iot.Device.Apa102, 1.2.613"
使用 #r 指令可以在 F# Interactive 和 Polyglot Notebooks 中使用。将以下内容复制到交互式工具或脚本的源代码中,以引用包。
// Install nanoFramework.Iot.Device.Apa102 as a Cake Addin #addin nuget:?package=nanoFramework.Iot.Device.Apa102&version=1.2.613 // Install nanoFramework.Iot.Device.Apa102 as a Cake Tool #tool nuget:?package=nanoFramework.Iot.Device.Apa102&version=1.2.613
NuGet 团队不提供对 Cake 客户端的支持。请联系其 维护者 以获得支持。
APA102 - 双线传输集成控灯 LED
APA102 是一个集控制电路和 RGB 芯片于一体的智能控制 LED 灯源,集成了 5050/2020 组件。内部包含 3 组移位寄存器和自检解码电路。
与 WS2812 不同的是,除了数据线外,它还有一个时钟线。因此 APA102 对时序没有严格的要求,对像 Raspberry Pi 这样无法精确控制数据线时序的设备更为友好。
还有其他类似型号,如 APA107、HD107s、SK9822 等,控制方式完全相同。
型号 | SCLK | PWM |
---|---|---|
APA102 | 20 MHz | 20 kHz |
APA107 | 30 MHz | 9 kHz |
HD107s | 40 MHz | 27 kHz |
SK9822 | 15 MHz | 4.7 kHz |
文档
- APA102
- SK9822
- 比较 SK6822 WS2813 APA102 SK9822 LED
- APA102、APA107、HD107s 和 SK9822 的区别
用法
重要:在创建 SpiDevice
之前,请确保正确设置 SPI 引脚,特别是对于 ESP32,请确保您已安装 nanoFramework.Hardware.ESP32 nuget
//////////////////////////////////////////////////////////////////////
// when connecting to an ESP32 device, need to configure the SPI GPIOs
// used for the bus
Configuration.SetPinFunction(21, DeviceFunction.SPI1_MOSI);
Configuration.SetPinFunction(22, DeviceFunction.SPI1_MISO);
Configuration.SetPinFunction(23, DeviceFunction.SPI1_CLOCK);
// Make sure as well you are using the right chip select
对于 STM32 等其他设备,请确保您正在使用您想要使用的 SPI 总线的预置引脚。芯片选择也可以提前设置。
以下是如何使用 APA102 的一个示例
using System;
using System.Device.Spi;
using System.Drawing;
using System.Threading;
using Iot.Device.Apa102;
var random = new Random();
using SpiDevice spiDevice = SpiDevice.Create(new SpiConnectionSettings(1, 42)
{
ClockFrequency = 20_000_000,
DataFlow = DataFlow.MsbFirst,
Mode = SpiMode.Mode0 // ensure data is ready at clock rising edge
});
using Apa102 apa102 = new Apa102(spiDevice, 16);
while (true)
{
for (var i = 0; i < apa102.Pixels.Length; i++)
{
apa102.Pixels[i] = Color.FromArgb(255, random.Next(256), random.Next(256), random.Next(256));
}
apa102.Flush();
Thread.Sleep(1000);
}
产品 | 版本 兼容和额外的计算目标框架版本。 |
---|---|
.NET 框架 | net 是兼容的。 |
-
- nanoFramework.CoreLibrary (>= 1.15.5)
- nanoFramework.Graphics.Core (>= 1.2.15)
- nanoFramework.Runtime.Events (>= 1.11.18)
- nanoFramework.System.Device.Gpio (>= 1.1.41)
- nanoFramework.System.Device.Spi (>= 1.3.52)
- UnitsNet.nanoFramework.Length (>= 5.56.0)
NuGet 包
此包没有被任何 NuGet 包使用。
GitHub 仓库
此包没有被任何流行的 GitHub 仓库使用。
版本 | 下载 | 最后更新 |
---|---|---|
1.2.613 | 61 | 8/9/2024 |
1.2.601 | 60 | 7/26/2024 |
1.2.590 | 76 | 7/17/2024 |
1.2.580 | 80 | 6/28/2024 |
1.2.573 | 84 | 6/19/2024 |
1.2.570 | 97 | 6/14/2024 |
1.2.560 | 82 | 5/29/2024 |
1.2.548 | 69 | 5/15/2024 |
1.2.536 | 100 | 4/15/2024 |
1.2.514 | 100 | 3/22/2024 |
1.2.494 | 103 | 2/28/2024 |
1.2.474 | 113 | 1/24/2024 |
1.2.462 | 133 | 1/5/2024 |
1.2.458 | 126 | 12/20/2023 |
1.2.436 | 153 | 11/10/2023 |
1.2.403 | 136 | 10/6/2023 |
1.2.396 | 128 | 9/27/2023 |
1.2.384 | 142 | 9/6/2023 |
1.2.378 | 148 | 8/16/2023 |
1.2.369 | 168 | 8/2/2023 |
1.2.363 | 154 | 7/28/2023 |
1.2.357 | 148 | 7/19/2023 |
1.2.354 | 147 | 7/14/2023 |
1.2.345 | 151 | 6/21/2023 |
1.2.341 | 155 | 6/14/2023 |
1.2.337 | 191 | 6/7/2023 |
1.2.335 | 181 | 6/2/2023 |
1.2.329 | 174 | 5/26/2023 |
1.2.313 | 171 | 5/12/2023 |
1.2.308 | 161 | 5/11/2023 |
1.2.304 | 164 | 5/10/2023 |
1.2.302 | 189 | 5/10/2023 |
1.2.297 | 185 | 5/3/2023 |
1.2.273 | 247 | 3/17/2023 |
1.2.267 | 246 | 3/10/2023 |
1.2.263 | 243 | 3/8/2023 |
1.2.259 | 247 | 2/27/2023 |
1.2.256 | 288 | 2/24/2023 |
1.2.253 | 270 | 2/22/2023 |
1.2.222 | 331 | 1/9/2023 |
1.2.212 | 334 | 1/5/2023 |
1.2.208 | 330 | 1/3/2023 |
1.2.203 | 314 | 12/28/2022 |
1.2.159 | 369 | 11/14/2022 |
1.2.153 | 386 | 11/5/2022 |
1.2.141 | 428 | 10/25/2022 |
1.2.122 | 489 | 10/12/2022 |
1.2.114 | 406 | 10/8/2022 |
1.2.95 | 455 | 9/22/2022 |
1.2.87 | 519 | 9/15/2022 |
1.2.73 | 464 | 9/8/2022 |
1.2.63 | 443 | 9/3/2022 |
1.2.47 | 436 | 8/15/2022 |
1.2.40 | 490 | 8/6/2022 |
1.2.38 | 484 | 8/5/2022 |
1.2.28 | 478 | 8/1/2022 |
1.2.13 | 471 | 7/24/2022 |
1.2.10 | 456 | 7/23/2022 |
1.2.5 | 494 | 7/13/2022 |
1.1.145.58726 | 468 | 7/7/2022 |
1.1.141.41205 | 475 | 7/6/2022 |
1.1.133.52556 | 471 | 6/30/2022 |
1.1.121.35854 | 476 | 6/26/2022 |
1.1.116.8772 | 467 | 6/24/2022 |
1.1.113.2032 | 455 | 6/23/2022 |
1.1.102.51394 | 457 | 6/15/2022 |
1.1.99.36719 | 457 | 6/14/2022 |
1.1.72.29765 | 464 | 5/31/2022 |
1.1.64.21380 | 464 | 5/26/2022 |
1.1.54.28879 | 487 | 5/23/2022 |
1.1.40 | 471 | 5/5/2022 |
1.1.27 | 489 | 4/26/2022 |
1.1.20 | 503 | 4/21/2022 |
1.1.3 | 483 | 4/15/2022 |
1.1.1 | 491 | 4/14/2022 |
1.0.300 | 464 | 3/31/2022 |
1.0.288-preview.114 | 118 | 3/25/2022 |
1.0.288-preview.113 | 115 | 3/25/2022 |
1.0.288-preview.110 | 112 | 3/25/2022 |
1.0.288-preview.103 | 111 | 3/21/2022 |
1.0.288-preview.100 | 115 | 3/19/2022 |
1.0.288-preview.99 | 124 | 3/18/2022 |
1.0.288-preview.98 | 110 | 3/18/2022 |
1.0.288-preview.93 | 117 | 3/15/2022 |
1.0.288-preview.86 | 119 | 3/8/2022 |
1.0.288-preview.77 | 119 | 2/27/2022 |
1.0.288-preview.75 | 116 | 2/26/2022 |
1.0.288-preview.73 | 115 | 2/25/2022 |
1.0.288-preview.65 | 111 | 2/18/2022 |
1.0.288-preview.63 | 114 | 2/16/2022 |
1.0.288-preview.61 | 126 | 2/12/2022 |
1.0.288-preview.58 | 117 | 2/10/2022 |
1.0.288-preview.53 | 112 | 2/9/2022 |
1.0.288-preview.48 | 127 | 2/4/2022 |
1.0.288-preview.41 | 127 | 1/31/2022 |
1.0.288-preview.29 | 130 | 1/28/2022 |
1.0.288-preview.22 | 131 | 1/27/2022 |
1.0.288-preview.20 | 130 | 1/27/2022 |
1.0.288-preview.19 | 133 | 1/27/2022 |
1.0.288-preview.18 | 126 | 1/27/2022 |
1.0.288-preview.5 | 133 | 1/24/2022 |
1.0.288-preview.1 | 125 | 1/21/2022 |
1.0.272 | 160 | 1/10/2022 |
1.0.270 | 342 | 1/6/2022 |
1.0.259 | 361 | 12/9/2021 |
1.0.258 | 365 | 12/7/2021 |
1.0.243 | 5,980 | 11/23/2021 |
1.0.242 | 6,256 | 11/23/2021 |
1.0.221 | 159 | 10/19/2021 |
1.0.219 | 170 | 10/19/2021 |
1.0.218 | 197 | 10/18/2021 |
1.0.157 | 349 | 9/4/2021 |
1.0.155 | 348 | 8/31/2021 |
1.0.153 | 159 | 8/14/2021 |
1.0.151 | 173 | 8/6/2021 |
1.0.146 | 164 | 7/22/2021 |
1.0.136 | 228 | 7/17/2021 |
1.0.135 | 159 | 7/16/2021 |
1.0.134 | 169 | 7/15/2021 |
1.0.133 | 185 | 7/14/2021 |
1.0.129 | 160 | 7/6/2021 |
1.0.127 | 173 | 7/5/2021 |
1.0.125 | 200 | 7/5/2021 |
1.0.122 | 211 | 6/30/2021 |
1.0.121 | 203 | 6/29/2021 |
1.0.119 | 221 | 6/28/2021 |
1.0.111 | 180 | 6/14/2021 |
1.0.105 | 282 | 5/29/2021 |
1.0.104 | 243 | 5/29/2021 |
1.0.97 | 180 | 5/28/2021 |
1.0.63 | 175 | 5/26/2021 |
1.0.23 | 216 | 5/21/2021 |