#include "Keyboard.h" const int buttonPin = 11; // input pin for pushbutton const int ledPin = 1; // the number of the LED pin int previousButtonState = HIGH; // for checking the state of a pushButton void setup() { // make the pushButton pin an input: pinMode(buttonPin, INPUT); // initialize the LED pin as an output: pinMode(ledPin, OUTPUT); // initialize control over the keyboard:218 Keyboard.begin(); } void loop() { // read the pushbutton: int buttonState = digitalRead(buttonPin); // if the button state has changed, if ((buttonState != previousButtonState) // and it's currently pressed: && (buttonState == HIGH)) { // type out a message digitalWrite(ledPin, LOW); delay(1000); digitalWrite(ledPin, HIGH); Keyboard.print(218); } // save the current button state for comparison next time: previousButtonState = buttonState; }