err: lvalue required as left operand of assignment

I get this error (error: lvalue required as left operand of assignment) with the following code:

void loop(){
  Serial.println("What do you want to do?");
  Serial.println("{1}Change pin state");
  [u][b]if (Serial.available() = 1){
[/b][/u]    serialData = Serial.read;
    switch(serialData){
      case 1: action1(); break;
      default: error(1); break;
    }
  }
}

I am writing a computer interface to control Arduino with just the builtin serial interface. Knowing me, it won't get far. :stuck_out_tongue:

if (Serial.available() = 1){

= is an assignment operator. == is a comparison operator.

This code is trying to assign the value 1 to Serial.read(), which it can't do.

Thank you. I forgot.