diff --git a/examples/Print_Hello/Print_Hello.ino b/examples/Print_Hello/Print_Hello.ino new file mode 100644 index 0000000..bdaaf69 --- /dev/null +++ b/examples/Print_Hello/Print_Hello.ino @@ -0,0 +1,19 @@ +//Example to understand the basic working of the Keyboard.write() function + +#include + +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); + Keyboard.begin(); +} + +void loop() { + //if the button is pressed + if (digitalRead(2) == LOW) { + //Send the message + Keyboard.print("Hello!"); + } +}