Activating a motion sensor

This code works perfectly, What I want is to start working but when I send an item, such as a letter a. As I can do?

int buttonPin = 2; // the number of the pushbutton pin
int ledPin = 13;
int buttonState = 0;
void setup(){  
    Serial.begin(9600); 
      // led como salida:
  pinMode(ledPin, OUTPUT);
  // sensor como entrada:
  pinMode(buttonPin, INPUT);
}  
void loop() {     
buttonState = digitalRead( buttonPin);
if (buttonState == HIGH) {
    digitalWrite(ledPin, HIGH);
    }
else {
    // turn LED off:
    digitalWrite(ledPin, LOW);
    }
}

What I want is to start working but when I send an item, such as a letter a. As I can do?

You have our permission to do that.

How are you going to send the Arduino an "item"? Does the post office have a way to deliver a letter to the Arduino?

If you mean to use the serial port, Serial.begin(), Serial.available(), and Serial.read() are some useful functions to look up.

The Tools + Auto Format is also something for you to investigate.