This commit is contained in:
Serge
2024-04-19 16:40:52 +02:00
parent c6247f630c
commit b6682522d8
2 changed files with 8 additions and 6 deletions

View File

@@ -102,7 +102,7 @@ namespace GHelper.AnimeMatrix
switch ((SlashMode)running)
{
case SlashMode.Static:
deviceSlash.SetStatic();
deviceSlash.SetStatic(brightness);
break;
default:
deviceSlash.SetMode((SlashMode)running);

View File

@@ -117,12 +117,14 @@ namespace GHelper.AnimeMatrix
Set(Packet<SlashPacket>(0xD3, 0x04, 0x00, 0x0C, 0x01, modeByte, 0x02, 0x19, 0x03, 0x13, 0x04, 0x11, 0x05, 0x12, 0x06, 0x13), "SlashMode");
}
public void SetStatic()
public void SetStatic(int brightness = 0)
{
byte brightnessByte = (byte)(brightness * 85.333);
Set(Packet<SlashPacket>(0xD2, 0x02, 0x01, 0x08, 0xAC), "Static");
Set(Packet<SlashPacket>(0xD3, 0x03, 0x01, 0x08, 0xAC, 0xFF, 0xFF, 0x01, 0x05, 0xFF, 0xFF), "Static");
Set(Packet<SlashPacket>(0xD3, 0x00, 0x00, 0x07), "Static");
Set(Packet<SlashPacket>(0xD4, 0x00, 0x00, 0x01, 0xAC), "Static");
Set(Packet<SlashPacket>(0xD3, 0x03, 0x01, 0x08, 0xAC, 0xFF, 0xFF, 0x01, 0x05, brightnessByte, 0xFF), "StaticSettings");
Set(Packet<SlashPacket>(0xD4, 0x00, 0x00, 0x01, 0xAC), "StaticSave");
Set(Packet<SlashPacket>(0xD3, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), "Static White");
}