Button Pressing

sterretje:
Simplest way (for two buttons)

#include <Keyboard.h>

void setup() {
  // make pin 2 an input and turn on the
  // pullup resistor so it goes high unless
  // connected to ground:
  pinMode(2, INPUT_PULLUP);
  pinMode(3, INPUT_PULLUP);
  Keyboard.begin();
}

void loop() {
  //if the button on pin 2 is pressed
  if(digitalRead(2)==LOW)  {
    //Send the message
    Keyboard.print("Hello!");
    delay(1500);
  }
  //if the button on pin 3 is pressed
  if(digitalRead(3)==LOW)  {
    //Send the message
    Keyboard.print("World!");
    delay(1500);
  }
}



It's crude but will work. How many buttons?

Thanks it worked but for some reason when I try to make it, it doesn't work could you please make the file with 11 buttons.