Code not doing what I tell it to do?

What I'm using is the Arduino Uno. I'm simulating a temperature control system just like the ac in your cars. The problem with my code is that. I'm using the Up & Down button on my IR remote. The UP button is suppose to increased the desired temperature by one and the down button decreases it by one. But for some reason when I push the down button, it increases the value by one. Another problem is that, when the value of the desired temperature goes over +2 of the value of the current temperature, it stops and won't allow me to changed the desired temperature without resetting the system. I want it to be continuous. Please help thank you!

CODE :
#include <Wire.h>
#include <LiquidCrystal_PCF8574.h>
#include <TinyDHT.h>
#include <IRremote.h>

#define DHTPIN 2
#define DHTTYPE DHT11

#define UP 0xFF629D
#define DOWN 0xFFA857

const int THpin = 2;
const int DCONE = 3;
const int DCTWO = 4;
const int IRPIN = 5;
const int COOLPIN = 8;
const int HEATPIN = 9;

LiquidCrystal_PCF8574 lcd(0x27);
DHT dht(DHTPIN, DHTTYPE);
IRrecv irrecv(IRPIN);
decode_results results;

int TEMP = 0;
int DETEMP = 70;
int DISTEMP = 70;
int CURTEMP = 70;
unsigned long NETEMP;
unsigned long CUTIME;

void setup() {
int error;
Serial.begin(9600);
Wire.begin();
Wire.beginTransmission(0x27);
error = Wire.endTransmission();
Serial.print("Error: ");
Serial.print(error);

lcd.begin(16, 2);
lcd.setBacklight(255);
lcd.clear();
dht.begin();

pinMode(DCONE, OUTPUT);
pinMode(DCTWO, OUTPUT);
irrecv.enableIRIn();

pinMode(COOLPIN, OUTPUT);
pinMode(HEATPIN, OUTPUT);

int16_t readTemperature(bool S = true);
NETEMP = millis();
}

void loop() {

if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);

if (results.value = UP) {
TEMP = 1;
DETEMP++;
}
else if (results.value = DOWN) {
TEMP = 1;
DETEMP--;
}
irrecv.resume();
delay(100);
}
if (TEMP = 1) {
DISTEMP = DETEMP;
}
else {
DISTEMP = CURTEMP;
DETEMP = CURTEMP;
}
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(DETEMP);

if (CURTEMP<(DETEMP-2)) {
digitalWrite(COOLPIN, LOW);
digitalWrite(HEATPIN, HIGH);
analogWrite(DCONE,0);
analogWrite(DCTWO,250);
}
else if (CURTEMP>(DETEMP+2)) {
digitalWrite(COOLPIN, HIGH);
digitalWrite(HEATPIN, LOW);
analogWrite(DCONE,0);
analogWrite(DCTWO,250);
}
else {
digitalWrite(COOLPIN, LOW);
digitalWrite(HEATPIN,LOW);
analogWrite(DCONE,0);
analogWrite(DCTWO,0);
}
CUTIME = millis();
if (CUTIME>NETEMP) {
int16_t t = dht.readTemperature(1);
NETEMP = CUTIME + 60000;
}
delay(200);
int16_t t = dht.readTemperature(1);
if (t==BAD_TEMP) {
Serial.println("Failed to read from DHI");
}
else {
Serial.print("Temperature:");
Serial.print(t);
Serial.println(" *F");
}
delay(2000);
}

if (results.value = UP)Oops

Multiple times.

Please remember to use code tags when posting code

Please follow the advice on posting a programming question given in Read this before posting a programming question

In particular note the advice to Auto format code in the IDE and to use code tags when posting code here as it prevents some combinations of characters in code being interpreted as HTML commands such as italics, bold or a smiley character, all of which render the code useless

oldest programmers wisdom:

a program does always what you have programmed. Though if the program does something different than you expect you don't understand your program yet and have to go through each line of code again to really understand what it does.

To speed up understanding what your code really does add serial-debug-output everywhere you find it sueful

always use millis() this way

if(currentTime - TimeStamp >= DelayTime) this will ensure that a rollover of millis() will be calculated correctly

best regards Stefan

As you are a newbie, and not sure of your "C" programming experience

  if (results.value = UP) {
      TEMP = 1;
      DETEMP++;
     }
     else if (results.value = DOWN) {
      TEMP = 1;
      DETEMP--;
     }

= is assignment
== is comparator
Do var=DOWN sets var to DOWN and the if statement then just checks that value.