static void Main(string[] args) { LedDisplay display = new LedDisplay(32, 16, SerialPort.GetPortNames()[0]); display.OpenSerial(); display.DrawBitmap(new Bitmap("bitmap.bmp"), 0, 0, 32, 16); display.RefreshDisplay(); for (byte i = 255; i > 0; i -= 5) { Console.WriteLine("Brightness: " + i); display.SetBrightness(i); Thread.Sleep(250); } }
static void Main(string[] args) { LedDisplay display = new LedDisplay(32, 16, SerialPort.GetPortNames()[0]); display.OpenSerial(); display.SetBrightness(175); while (true) { display.ClearDisplay(); String time = DateTime.Now.ToString("HH:mm"); display.DrawString(0, 4, LedColor.Red, time, 0, Fonts.Font6X8); display.RefreshDisplay(); Thread.Sleep(2000); } }
static void Main(string[] args) { LedDisplay display = new LedDisplay(32, 16, SerialPort.GetPortNames()[0]); display.OpenSerial(); display.SetBrightness(120); display.FillDisplay(LedColor.White); display.RefreshDisplay(); Thread.Sleep(1000); Console.WriteLine("Drawing Lines"); display.DrawLine(0, 0, 5, 10, LedColor.Red); display.DrawLine(5, 0, 10, 10, LedColor.Green); display.DrawLine(10, 0, 15, 10, LedColor.Blue); display.RefreshDisplay(); Thread.Sleep(1000); Console.WriteLine("Drawing circles"); display.ClearDisplay(); display.DrawCircle(12, 6, 5, LedColor.Yellow); display.RefreshDisplay(); Thread.Sleep(1000); Console.WriteLine("Drawing rectangles"); display.ClearDisplay(); display.DrawRectangle(0, 0, 10, 12, LedColor.Orange, LedColor.Cyan); display.DrawRectangle(15, 0, 18, 4, LedColor.Purple); display.RefreshDisplay(); Thread.Sleep(1000); Console.WriteLine("Drawing text"); String time = DateTime.Now.ToString("HH:mm"); display.ClearDisplay(); display.DrawString(0, 0, LedColor.Blue, time, 0, Fonts.Font6X8); display.RefreshDisplay(); Console.ReadKey(); }