Small problem on receiving command from Serial to turn on pin

Sorry I'm really new to coding and the Arduino and I am not sure what I'm doing wrong in this code to send a command from the serial monitor to my Arduino Uno and have it send out power through a pin (in my case pin 13 for a simple led).

int led = 13;
char serial = Serial.read();

void setup(){
Serial.begin(9600);
pinMode(13, OUTPUT);
}
void loop(){
* if (serial == 'motor'){*
* Serial.println ('led turning on');*
* digitalWrite (13, HIGH);*
* };*
}

The code uploads but I hooked up my multimeter and their was still no voltage when I typed motor into the Serial monitor.

Simple test code.

// zoomkat 8-6-10 serial I/O string test
// type a string in serial monitor. then send or enter
// for IDE 0019 and later

int ledPin = 13;
String readString;

void setup() {
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT); 
  Serial.println("serial on/off test 0021"); // so I can keep track
}

void loop() {

  while (Serial.available()) {
    delay(3);  
    char c = Serial.read();
    readString += c; 
  }

  if (readString.length() >0) {
    Serial.println(readString);

    if (readString == "on")     
    {
      digitalWrite(ledPin, HIGH);
    }
    if (readString == "off")
    {
      digitalWrite(ledPin, LOW);
    }

    readString="";
  } 
}
char Serial = Serial.read();

How is your sketch supposed to read Serial data right after power on/restart, before any of it's hardware is initialized and you haven't even sent it anything?

  if (serial == 'motor'){

motor isn't a single character, so you shouldn't be comparing it against one. It's a string.

I recommend looking at some of the examples to familiarize yourself with how to read things in from the Serial monitor.

    Serial.println ('led turning on');

Look up the difference between single and double quotes. It is very important in C / C++.

Okay. Sorry about the really simple problem I should have gone and done more research before asking.

It was a decent attempt!

int led = 13;
byte incomingByte;  // variable to hold incoming databyte

void setup(){

  Serial.begin(9600);
  pinMode(13, OUTPUT);
}

void loop(){
  if (Serial.available()>0){ // any data received?
    incomingByte = Serial.read(); // read it

    if (incomingByte == '0'){  // act on the data
      Serial.println ("led turning on");
      digitalWrite (13, HIGH);
    }
    if (incomingByte == '1'){  // or act on the data
      Serial.println ("led turning off");
      digitalWrite (13, LOW);
    }
    if (( incomingByte != '1') && (incomingByte !='0')){ // or report it as bad
      Serial.println ("bad data");
    }
  }
}