static void Main()
    {
        IPConnection       ipcon = new IPConnection();                 // Create IP connection
        BrickletJoystickV2 j     = new BrickletJoystickV2(UID, ipcon); // Create device object

        ipcon.Connect(HOST, PORT);                                     // Connect to brickd
        // Don't use device before ipcon is connected

        // Register pressed callback to function PressedCB
        j.PressedCallback += PressedCB;

        // Set period for pressed callback to 0.01s (10ms)
        j.SetPressedCallbackConfiguration(10, true);

        Console.WriteLine("Press enter to exit");
        Console.ReadLine();
        ipcon.Disconnect();
    }