Help me about this Flow Chart ( project smarthome in my school )

I tried programming follow flowchart but apparently it does not work the way I want, my project is infrared remote control, help me please !! Thanks very much !!

FlowChart.pdf (109 KB)

What is “it”?
What is “the way I want”?

aarg:
What is "it"?
What is "the way I want"?

it's seem not working !!

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <IRremote.h> 

LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address
const int receiverPin = 8; 
IRrecv irrecv(receiverPin); 
decode_results results;

const int Lamp1 = 6;
const int Lamp2 = 7;


boolean stateLamp1 = false;
boolean stateLamp2 = false;

void setup()

{ lcd.clear();
  lcd.begin(16, 2);
  lcd.setCursor(0, 0);
  lcd.print("SmartHome");
  delay(2000);
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Remote:3");
  lcd.setCursor(0, 1);
  lcd.print("Manual:4");

  Serial.begin(9600);// serial
  irrecv.enableIRIn(); // start the IR receiver
  pinMode(Lamp1, OUTPUT);
  pinMode(Lamp2, OUTPUT);

}

void loop()
{
  if (irrecv.decode(&results)) 
  {
    translateIR();
    Serial.println(results.value, HEX);
    delay(200);
    irrecv.resume(); 
  }
}

// translate IR signals
void translateIR()
{ switch (results.value)
  {
    //num1
    case 0xCB97AA2B:  {
        stateLamp1 = !stateLamp1;
        digitalWrite(Lamp1, stateLamp1);
        lcd.clear();
        lcd.setCursor(0, 0);
        lcd.print("Lamp:");
        lcd.setCursor(0, 1);
        lcd.print("Mode: Remote");
        check_state();
      }

      break;
    //num2
    case 0xCA15D94F: {
        stateLamp2 = !stateLamp2;
        digitalWrite(Lamp2, stateLamp2);
        lcd.clear();
        lcd.setCursor(0, 0);
        lcd.print("Lamp:");
        lcd.setCursor(0, 1);
        lcd.print("Mode: Remote");
        check_state();
      }
      break;

    //num3
    case 0x42445897:
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print("Lamp:");
      lcd.setCursor(0, 1);
      lcd.print("Mode: Remote");
      break;

    //num4
    case 0xE5DE7E0B:
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print("Lamp:");
      lcd.setCursor(0, 1);
      lcd.print("Mode: Manual");
      break;

    //num9
    case 0x8E676CB1:
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print("SmartHome");
      delay(2000);
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print("Remote:3");
      lcd.setCursor(0, 1);
      lcd.print("Manual:4");
  }
}
void check_state() {
  if (stateLamp1 == HIGH && stateLamp2 == LOW )
  {
    lcd.setCursor(6, 0);
    lcd.print("Lamp_1_ON");
  }
  else if (stateLamp1 == LOW && stateLamp2 == HIGH )
  {
    lcd.setCursor(6, 0);
    lcd.print("Lamp_2_ON");
  }
  else if (stateLamp1 == LOW && stateLamp2 == LOW )
  {
    lcd.setCursor(6, 0);
    lcd.print("Lamp_OFF");
  }
  else
  {
    lcd.setCursor(6, 0);
    lcd.print("Lamp_ON");
  }
}

Welcome to the Forum. Please read the two posts at the top of this Forum by Nick Gammon on guidelines for posting here, especially the use of code tags which make the code looklike thiswhen posting source code files. Also, before posting the code, use Ctrl-T in the IDE to reformat the code in a standard format, which makes it easier for us to read.

If you have already posted without using code tags, open your message and select “modify” from the pull down menu labelled, “More”, at the lower left corner of the message. Highlight your code by selecting it (it turns blue), and then click on the “</>” icon at the upper left hand corner. Click on the “Save” button.

Have you run the example sketch that came with the IR library, to verify that the hardware is working?

aarg:
Have you run the example sketch that came with the IR library, to verify that the hardware is working?

Example is working, but i don't know how to loop in " Remote Mode " :frowning: !!