This commit is contained in:
Serge
2024-04-18 12:52:49 +02:00
parent ad3d31cba4
commit 51bf22e6a6
2 changed files with 22 additions and 4 deletions

View File

@@ -98,9 +98,18 @@ namespace GHelper.AnimeMatrix
} }
deviceSlash.Init(); deviceSlash.Init();
switch ((SlashMode)running)
{
case SlashMode.Static:
deviceSlash.SetStatic();
break;
default:
deviceSlash.SetMode((SlashMode)running); deviceSlash.SetMode((SlashMode)running);
deviceSlash.SetOptions(true, brightness, inteval); deviceSlash.SetOptions(true, brightness, inteval);
deviceSlash.Save(); deviceSlash.Save();
break;
}
} }
}); });
} }

View File

@@ -19,7 +19,8 @@ namespace GHelper.AnimeMatrix
Ramp, Ramp,
GameOver, GameOver,
Start, Start,
Buzzer Buzzer,
Static
} }
internal class SlashPacket : Packet internal class SlashPacket : Packet
@@ -53,6 +54,7 @@ namespace GHelper.AnimeMatrix
{ SlashMode.GameOver, "Game Over"}, { SlashMode.GameOver, "Game Over"},
{ SlashMode.Start, "Start"}, { SlashMode.Start, "Start"},
{ SlashMode.Buzzer, "Buzzer"}, { SlashMode.Buzzer, "Buzzer"},
{ SlashMode.Static, "Static"},
}; };
private static Dictionary<SlashMode, byte> modeCodes = new Dictionary<SlashMode, byte> private static Dictionary<SlashMode, byte> modeCodes = new Dictionary<SlashMode, byte>
@@ -115,6 +117,13 @@ namespace GHelper.AnimeMatrix
Set(Packet<SlashPacket>(0xD3, 0x04, 0x00, 0x0C, 0x01, modeByte, 0x02, 0x19, 0x03, 0x13, 0x04, 0x11, 0x05, 0x12, 0x06, 0x13), "SlashMode"); Set(Packet<SlashPacket>(0xD3, 0x04, 0x00, 0x0C, 0x01, modeByte, 0x02, 0x19, 0x03, 0x13, 0x04, 0x11, 0x05, 0x12, 0x06, 0x13), "SlashMode");
} }
public void SetStatic()
{
Set(Packet<SlashPacket>(0xD3, 0x00, 0x00, 0x07), "Static");
Set(Packet<SlashPacket>(0xD3, 0x00, 0x00, 0x01, 0xAC), "Static");
Set(Packet<SlashPacket>(0xD3, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), "StaticWhite");
}
public void SetOptions(bool status, int brightness = 0, int interval = 0) public void SetOptions(bool status, int brightness = 0, int interval = 0)
{ {
byte brightnessByte = (byte)(brightness * 85.333); byte brightnessByte = (byte)(brightness * 85.333);