Soi am trying to use the multichannel Gas sensor v1.0 and the code proved does not work I have tried everything but all it says is the gas is not declared
void setup()
{
Serial.begin(115200); // start serial for output
Serial.println(“power on!”);
gas.begin(0x04);//the default I2C address of the slave is 0x04
gas.powerOn();
Serial.print("Firmware Version = ");
Serial.println(gas.getVersion());
}
void loop()
{
float c;
c = gas.measure_NH3();
Serial.print(“The concentration of NH3 is “);
if(c>=0) Serial.print©;
else Serial.print(“invalid”);
Serial.println(” ppm”);
c = gas.measure_CO();
Serial.print(“The concentration of CO is “);
if(c>=0) Serial.print©;
else Serial.print(“invalid”);
Serial.println(” ppm”);
c = gas.measure_NO2();
Serial.print(“The concentration of NO2 is “);
if(c>=0) Serial.print©;
else Serial.print(“invalid”);
Serial.println(” ppm”);
c = gas.measure_C3H8();
Serial.print(“The concentration of C3H8 is “);
if(c>=0) Serial.print©;
else Serial.print(“invalid”);
Serial.println(” ppm”);
c = gas.measure_C4H10();
Serial.print(“The concentration of C4H10 is “);
if(c>=0) Serial.print©;
else Serial.print(“invalid”);
Serial.println(” ppm”);
c = gas.measure_CH4();
Serial.print(“The concentration of CH4 is “);
if(c>=0) Serial.print©;
else Serial.print(“invalid”);
Serial.println(” ppm”);
c = gas.measure_H2();
Serial.print(“The concentration of H2 is “);
if(c>=0) Serial.print©;
else Serial.print(“invalid”);
Serial.println(” ppm”);
c = gas.measure_C2H5OH();
Serial.print(“The concentration of C2H5OH is “);
if(c>=0) Serial.print©;
else Serial.print(“invalid”);
Serial.println(” ppm”);
delay(1000);
}
Hello,
sounds that you have not included the head file yet.
please copy those two lines of code into your sketch.
</s><i>
</i>// Read Data from Grove - Multichannel Gas Sensor
#include <Wire.h>
#include "MutichannelGasSensor.h"
<e>
Gook luck!