two lm35 sensors for checking the temperature difference

Hi guys, I am new to programming and have been learning it recently for a project.

I was able to code and check the output of two LM35 sensors. One Lm35 will be inside a cabin and the other outside it, how do I change the program so that based on a certain limit say 30 degree Celsius inside the cabin I will be able to activate a solar film.

The current code which I have now is

float temp1, temp2;
int tempPin1 = 0;
int tempPin2 = 1;

void setup() {

void loop() {
temp1 = analogRead(tempPin1);
temp1 = temp1 * 0.4887585533;
temp2 = analogRead(tempPin2);
temp2 = temp2 * 0.4887585533;

Serial.print("Inside_Temperature = “);
Serial.print(”*C ");
Serial.print("Outside_Temperature = “);
Serial.print(”*C ");

Are you familiar with the following Control Structures – one of them could be used for your application?

1. if-else

if(this_argument _is _true) //x == y(equal), x<y(less than), x=<y, x>y, x>=y, x != y
    //do this
    //do this

2. do-while

3. while-do

4. for()

5. switch-case

Okay thanks I will try to learn and implement the use of these conditions.

You chose a good part. I have no idea what your background is so I am going to assume not analog. If the remote sensor leads are long I would recommend looking at the TI data sheet and at Two-Wire Remote Temperature Sensor, this is actually sending data in current mode where a resistor can convert back to a voltage. This configuration has a high noise immunity. However you package it add a small capacitor across the power supply to help reduce noise. Read the 10.1 Layout Guidelines in the data sheet. It has a very slow response, will take three to four minutes to reach final value.
Good Luck & Have Fun!