Finde die Unterschiede:
void GasSensor(byte pin) {
float sensor_volt;
float RS_gas; // Get value of RS in a GAS
float ratio; // Get ratio RS_GAS/RS_air
int sensorValue = analogRead(pin);
sensor_volt=(float)sensorValue/1024*5.0;
RS_gas = (5.0-sensor_volt)/sensor_volt; // omit *RL
/*-Replace the name "R0" with the value of R0 in the demo of First Test -*/
ratio = RS_gas/34; // ratio = RS/R0
/*-----------------------------------------------------------------------*/
Serial.print("sensor_"); Serial.println((int)pin);
Serial.print("sensor_volt = ");
Serial.println(sensor_volt);
Serial.print("RS_ratio = ");
Serial.println(RS_gas);
Serial.print("Rs/R0 = ");
Serial.println(ratio);
Serial.print("\n\n");
}
dazu passt
void loop() {
GasSensor(A2);
GasSensor(A1);
GasSensor(A0);
delay(1000);
}
War doch nicht so schwer, oder?
Mit unterschiedlichen Kalibrierungswerten musst du jetzt noch was machen.
Viel Spass!