Error in code from arduino tutorial

Hi guys,
I'm new to Arduino so sorry in advance if this is a really stupid question.
I used the Arduino code to read in serial data from the youtube arduino tutorial (MATLAB Arduino Tutorial 1 - Serial Connection between Arduino UNO to Matlab via USB - YouTube).

void setup()
{
// initialize serial communication at 9600 bps:
Serial.begin(9600);
// Check serial communication - acknowledgement routine
Serial.println('a'); // sending a character to PC
char a = 'b';
while (a ! = 'a')
{
// wait for a specific charchter from the PC
a = Serial.read();

}
}

However, the "while (a ! = 'a')" line gives me the error "expected ')' before '!' token" and I don't really know how to fix it.

Thanks!

Don't put a space in ! =

it has to be !=

Next time, please post your code in code tags. Of if you're a great guy (/gal), edit your post as well. See How to use this forum.

And uhm, you typed it over wrong. Difference between != and ! = :wink: