forked from nanoframework/nanoFramework.IoT.Device
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWs2815B.cs
29 lines (27 loc) · 1.2 KB
/
Ws2815B.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using nanoFramework.Hardware.Esp32.Rmt;
namespace Iot.Device.Ws28xx.Esp32
{
/// <summary>
/// Represents WS2815B LED driver.
/// </summary>
public class Ws2815b : Ws28xx
{
/// <summary>
/// Initializes a new instance of the <see cref="Ws2815b" /> class.
/// </summary>
/// <remarks>In contrast to <see cref="Ws2812b"/> this constructor changes the order of the color values.</remarks>
/// <param name="gpioPin">The GPIO pin used for communication with the LED driver.</param>
/// <param name="width">Width of the screen or LED strip.</param>
/// <param name="height">Height of the screen or LED strip. Defaults to 1 (LED strip).</param>
public Ws2815b(int gpioPin, int width, int height = 1)
: base(gpioPin, new BitmapImageNeo3Rgb(width, height))
{
ClockDivider = 2;
OnePulse = new RmtCommand(52, true, 52, false);
ZeroPulse = new RmtCommand(14, true, 52, false);
ResetCommand = new RmtCommand(1400, false, 1400, false);
}
}
}