static void Main() { IPConnection ipcon = new IPConnection(); // Create IP connection BrickletEPaper296x128 epaper = new BrickletEPaper296x128(UID, ipcon); // Create device object ipcon.Connect(HOST, PORT); // Connect to brickd // Don't use device before ipcon is connected // Download example image here: // https://raw.githubusercontent.com/Tinkerforge/e-paper-296x128-bricklet/master/software/examples/tf_red.png Bitmap bitmap = new Bitmap("tf_red.png"); // Get black/white pixels from image and write them to the Bricklet buffer bool[] pixelsBW = BoolArrayFromImage(bitmap, Color.White); epaper.WriteBlackWhite(0, (byte)0, WIDTH - 1, (byte)(HEIGHT - 1), pixelsBW); // Get red pixels from image and write them to the Bricklet buffer bool[] pixelsRed = BoolArrayFromImage(bitmap, Color.Red); epaper.WriteColor(0, (byte)0, WIDTH - 1, (byte)(HEIGHT - 1), pixelsRed); // Draw buffered values to the display epaper.Draw(); Console.WriteLine("Press enter to exit"); Console.ReadLine(); ipcon.Disconnect(); }
private static string UID = "XYZ"; // Change XYZ to the UID of your E-Paper 296x128 Bricklet static void Main() { IPConnection ipcon = new IPConnection(); // Create IP connection BrickletEPaper296x128 ep = new BrickletEPaper296x128(UID, ipcon); // Create device object ipcon.Connect(HOST, PORT); // Connect to brickd // Don't use device before ipcon is connected // Use black background ep.FillDisplay(BrickletEPaper296x128.COLOR_BLACK); // Write big white "Hello World" in the middle of the screen ep.DrawText(16, 48, BrickletEPaper296x128.FONT_24X32, BrickletEPaper296x128.COLOR_WHITE, BrickletEPaper296x128.ORIENTATION_HORIZONTAL, "Hello World"); ep.Draw(); Console.WriteLine("Press enter to exit"); Console.ReadLine(); ipcon.Disconnect(); }