public static void Main() { Console.WriteLine("Starting keypad driver..."); // setup keypad driver // using 0x20 as the default PCF8574 address // assuming this is connected to a 4x4 keypad var keypad = new Keypad( 0x20, "I2C2", GpioController.GetDefault().OpenStm32Pin('F', 9), 4, 4); // set event handlers keypad.KeyPressed += Keypad_KeyPressed; keypad.KeyReleased += Keypad_KeyReleased; //define example key map and set //this mapping works if you look keypad from back side char[][] Keys = new char[][] { new char[] { '1', '4', '7', '*' }, new char[] { '2', '5', '8', '0' }, new char[] { '3', '6', '9', '#' }, new char[] { 'A', 'B', 'C', 'D' } }; keypad.KeyMap = Keys; // enable key press handling keypad.EnableKeyPress(); Thread.Sleep(Timeout.Infinite); }