i2c- mega with uno (mega is master)

I’m trying to make an LED blink on my UNO when I type in an H in the serial monitor for the mega and the LED turn off when I type in L in the mega serial monitor. I’m getting power to both boards but the commands wont make the LED turn on/off. Any suggestions?

Master

// i2c master code
#include <Wire.h> 


void setup() {
  Serial.begin(9600); 
  
  Wire.begin(); 
   
  pinMode(13,OUTPUT); 
  digitalWrite(13,LOW);
  
}

void loop() {
 while(Serial.available()) 
 {
  char c = Serial.read(); 

  if ( c == 'H') 
  {
    Wire.beginTransmission(5); 
    Wire.write('H'); 
    Wire.endTransmission(); 
  }
  else if (c == 'L')
  {
    Wire.beginTransmission(5); 
    Wire.write('L'); 
    Wire.endTransmission(); 
  }
 }

}

slave

#include <Wire.h> 
char c ;
void setup() {
  Wire.begin(5); 
  Wire.onReceive(receiveEvent); 

  pinMode(13,OUTPUT); 
  digitalWrite(13,LOW); 
  
}

void loop() {
 

}

void receiveEvent(int howMany) 
{
  while(Wire.available()) {
    
  char c = Wire.read(); 

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

I also attached a picture of my wiring.

are you powering the UNO from Vin from the Mega? where did you connect the power?hard to see on the picture (did you connect the 5V output of the Mega to the Vin pin on the Uno?)

what are the resistors for?

I was actually able to figure out what was wrong. I had the baud rate in the serial monitor on something other than 9600. So I just had to change it to 9600 baud rate again and it started to work.