You just need to assign the sensors different pins.
/* GAS Sensor MQ-2
This sensor detects flammable gasses
the board has four pins
connect AO to Arduino pin A0
connect DO to Arduino pin 2
connect Gnd to Arduino Gnd
connect Vcc to Arduino 5 volts
*/
int sensorPin =gasSensorPin= A0; // select theGAS inputsensor pin for the potentiometer
int DOPin =DOpin= 2; // select the pin for the LED
int sensorValue =gasSensorValue= 0; // variable to store the value coming from the sensor
int ledPin =13;= 13;
int tempSensorPin = A1; //Temperature sensor pin
int tempSensorValue;
void setup() {
// declare the ledPin as an OUTPUT:
pinMode(DOPin, INPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
// read the value from the sensor:
sensorValue =gasSensorValue= analogRead(sensorPingasSensorPin);
Serial.print("Analog Output = ");
Serial.println(sensorValuegasSensorValue);
// turn the ledPin on if triggered
//
if (digitalRead(DOPinDOpin) ==HIGH== HIGH){
digitalWrite(ledPin, LOW);
Serial.println("Digital Output = OFF");
}
else {
digitalWrite(ledPin, HIGH);
Serial.println("Digital Output = ON");
}
Serial.print("Temperture: ");
tempSensorValue = analogRead(tempSensorPin));
Serial.println(analogRead(tempSensorPin)); //Print the value of pin A4
delay(1000);
}
This is your combined sketch.