With this code you can connect buttons with your Arduino Leonardo (Micro, etc.) and use them as keyboard.
- Define your "buttonPin1"
- Connect your Button. One Pin to the ground and the other one to your "buttonPin1".
- Create a instance of your class Button: "Button nummer1(buttonPin1,"0");"
- The first parameter ist you buttonPin and the other second ist you keyboard output.
- Call the class method "checkButton" to check the button input and do a keypress.