ARDUINO

Hello, I am trying to make this codes work but my only problem is when it prints mode2 or mood3 the codes dos not work at all. Do you know what should I do?
note: I also use visual studio with those codes.

#include “display.h”

//pins
const int KEY_ONE = 8;
const int KEY_TWO = 9;
const int RED_LED = 4;
const int GREEN_LED = 5;
const int BUZZER = 3;
const int TEMP_SENSOR = 15; //The temprature sensor is in pin 15
const int KNOB = 14; //The knob is in pin 14

char MODE[3] = { 1, 2, 3};

// OTHER VARIABLES:
// the currently active mode
int KEY_ONE_CURRENT_MODE = MODE[2] ;
int KEY_LAST_STATE = HIGH;
int KEY_TWO_LAST_STATE = HIGH; //high means it is not pressed
int LAST_KNOB = HIGH; // last knob state
// the maximum angle in degrees of the potmeter 0-30
const int MAX_ANGLE = 30;
// Temprature variables:
const int NTC_R25 = 10000; // the resistance of the NTC at 25’C is 10k ohm
const int NTC_MATERIAL_CONSTANT = 3950; // value provided by manufacturer
const int TEMP_HOT_THRESHOLD = 27; // hot if more
const int TEMP_COLD_THRESHOLD = 16; //cold if less

void setup() {
pinMode(KEY_ONE, INPUT_PULLUP);
pinMode(KEY_TWO, INPUT_PULLUP);
pinMode(RED_LED, OUTPUT);
pinMode(GREEN_LED, OUTPUT);
pinMode(BUZZER, OUTPUT);
pinMode(TEMP_SENSOR, INPUT_PULLUP);

Serial.begin(9600);
}
// knob codings
int get_knob_angle()
{
int sensor_value = analogRead(KNOB);
int angle;
// map is an Arduino library function.
// it maps one range to another range.
angle = map(sensor_value, 0, 1023, 0, MAX_ANGLE);

return angle;
}
//disply knob
/*void DISPLAY_MODE3(){

int angle;
angle = get_knob_angle();
Display.show(angle);
delay(500);

}*/
//get temperature ntc value
float get_temperature()
{

float temperature,resistance;
int tempSV= analogRead(TEMP_SENSOR); //sv is a short cut for sensitivty,this one is meassuring the temprature sensitivty
resistance = (float)tempSV * NTC_R25/(1024 - tempSV); // Calculate resistance
/* Calculate the temperature according to the following formula. */
temperature = 1/(log(resistance/NTC_R25)/NTC_MATERIAL_CONSTANT+1/298.15)-273.15;
return temperature;
}
//display temperature
/void DISPLAY_MODE2(){
float celcius;
celcius = get_temperature();
Display.show(celcius);
delay(1000);
if ( celcius < TEMP_COLD_THRESHOLD)
{
Serial.println(“cold”);
digitalWrite(GREEN_LED ,HIGH);
digitalWrite(RED_LED , LOW);
}
if (celcius > TEMP_HOT_THRESHOLD )
{
Serial.println(“hot”);
digitalWrite(RED_LED , HIGH);
digitalWrite(GREEN_LED , LOW);
}
}
/

void loop() {
//read keys states
int KEY_ONE_STATE = digitalRead(KEY_ONE);
int KEY_TWO_STATE = digitalRead(KEY_ONE);
Serial.println(KEY_ONE_CURRENT_MODE);
if (KEY_ONE_STATE == LOW){
int KEY_ONE_STATE = digitalRead(KEY_ONE);
delay(100); //delay for bouncing
Serial.println(“haha”);
if (KEY_ONE_STATE == LOW && KEY_ONE_STATE != KEY_LAST_STATE)
{

KEY_ONE_CURRENT_MODE = KEY_ONE_CURRENT_MODE +1;
if (KEY_ONE_CURRENT_MODE > 3)
{
KEY_ONE_CURRENT_MODE = 1;
}

Serial.println(“mode”);
Serial.println(KEY_ONE_CURRENT_MODE);
delay(100);

}

KEY_LAST_STATE = KEY_ONE_STATE;
}

String COMMAND = Serial.readString();
COMMAND.trim();
if (Serial.available() ){
Serial.println("Received " + COMMAND);
if (COMMAND == “MODE1”){

}
if (COMMAND == “MODE2”){
//DISPLAY_MODE2();
}
if (COMMAND == “MODE3”){
//DISPLAY_MODE3();
}
}
//check if knob value changed. If it did change the
int KNOB_STATE = digitalRead(KNOB);
if (KNOB_STATE == !LAST_KNOB){
int sensor_value = analogRead(KNOB);
delay(100);
if (KNOB_STATE == !LAST_KNOB){
// DISPLAY_MODE3();
}
LAST_KNOB = KNOB_STATE;
}

if (KEY_TWO_STATE == LOW){
int KEY_TWO_STATE = digitalRead(KEY_ONE);
delay(100); //delay for bouncing
if (KEY_TWO_STATE == LOW && KEY_TWO_STATE != KEY_TWO_LAST_STATE)
{

Serial.println(“on”); // alarm is on
tone(3,200,10000); /*1 s is 1000ms , therefor 10s are 10000ms

  • i asigned the buzeer for 10s becuse it is anoying
  • otherwise i would use digitalWrite(Buzzer, HIGH);delayMicroseconds(200);
    */
    }

KEY_TWO_LAST_STATE = KEY_TWO_STATE;
}
}

I don't see how your question can have anything to do with the working of this website so I have suggested to the Moderator to move it to the Programming section.

To make it easy for people to help you please modify your post and use the code button </>
codeButton.png

so your code 
looks like this

and is easy to copy to a text editor. See How to use the Forum

And please remove all the unnecessary blank lines.

...R