servicepoint-binding-csharp/ServicePoint.Example/Program.cs
Vinzenz Schroeter 335127b219
All checks were successful
Rust / build (push) Successful in 6m13s
fix endless example runs in pipeline
2025-02-16 17:08:18 +01:00

23 lines
653 B
C#

using System.Threading;
using ServicePoint;
// TODO: replace with new Connection("127.0.0.1:2342") to send to a real display
var connection = Connection.NewFake();
connection.Send(Command.Clear());
connection.Send(Command.Brightness(5));
connection.Send(Command.Utf8Data(0,0, CharGrid.Load("This is a test")));
var pixels = Bitmap.NewMaxSized();
for (ulong offset = 0; offset < pixels.Width(); offset++)
{
pixels.Fill(false);
for (ulong y = 0; y < pixels.Height(); y++)
pixels.Set((y + offset) % pixels.Width(), y, true);
connection.Send(Command.BitmapLinearWin(0, 0, pixels, CompressionCode.Lzma));
Thread.Sleep(14);
}