     delay(1000);
   }
 }
+
+void temperature(int MAX_TEMP){
+  float analogTmp = (float)analogRead(TEMPERATURE)*5/1024;
+  currTmp = 100*(analogTmp-0.5);
+  if(currTmp < MAX_TEMP){
+    digitalWrite(MOSFET,HIGH);
+  }else{
+    digitalWrite(MOSFET,LOW);
+  }
+}
+

#include <SoftwareSerial.h>
#define PPRON 1
#define PPROFF 2
#define FSRON 3
#define FSROFF 4
#define TMPUP 5
#define TMPDOWN 6
int INA = 9;  
int INB = 8;
int LED = 5; // LED를 5번핀에 연결합니다.
int PRESSURE = A0;
int TEMPERATURE = A1;
int MOSFET = 7 ;
bool isFSROn = false;
float Val;
float val;
SoftwareSerial BTSerial(2, 3);

void setup() {

  if(BTSerial.available()){
      byte response = BTSerial.read();
      switch(response){
        case PPR_ON :{
          Serial.println(response);
          digitalWrite(INA,HIGH);
          digitalWrite(INB,LOW); 
          break;
        }
        case PPR_OFF :{
          Serial.println(response);
          digitalWrite(INA,LOW);
          digitalWrite(INB,LOW); 
          break;
        }
        case FSR_ON :{
          Serial.println(response);
          isFSROn= true;
          break;
        }
        case FSR_OFF :{
          Serial.println(response);
          isFSROn = false;
          break;
        }
        case TMP_UP :{
          Serial.println(response);
          MAX_TEMP = response;
          isTMPOn = true;
          break;
        }
        case TMP_DOWN :{
          Serial.println(response);
          isTMPOn = false;
          break;
        }
      }
      
  }
  if(isTMPOn){
    temperature(MAX_TEMP);
  }
  
  if(isFSROn){
    int fsrData = analogRead(PRESSURE);
    Serial.println("Temperature : "+ String(fsrData));
