Help with Wire.write please

Hi everyone, this is my first post on these forums so apologies for any rules that I may have missed in regards to post formats etc.

I am a complete beginner to the Arduino world and have been researching as much as I can, however on my personal project I have hit a wall. please help..

This is the Master Mega 2560;

Wire.beginTransmission(1);
Wire.write("H");
Wire.endTransmission();

This is the Slave 1 Mega 2560;

void receiveEvent(int howMany)
{
  char inChar;

  while (Wire.available() > 0)
  {
    inChar = Wire.read();

    if (inChar == 'H' )
    {
      digitalWrite(13, HIGH);
    }
    else if (inChar == 'L')
    { digitalWrite(13, LOW);
    }
}
}

If I Wire.write ("H") the led on the slave turns on as expected;

However I'm looking to find out how to send and receive multiple characters,

for example;

MASTER || Wire.write ("HHH");

SLAVE 1 || if (inChar == ('HHH') ) //I seem to be having trouble getting the code to read HHH

Kind regards
Philip

The variable "char" occupies one byte and can hold just one character. Either read the "HHH" as 3 cgaracters, one at the time, or build a string that can contain several chars.

Use the function strcmp() to compare C-strings (zero terminated character arrays), not "==".

The Arduino Reference pages have the details on using the Wire functions.