TroubleshootingGravity

SEN0465

userHead nelson.purba 2023-06-16 16:34:53 284 Views2 Replies

Hello

 

I have a problem with oxgen sensor SEN:0465. 

I download the code from DF robot website, but when compiled error appear below. Please help me to solve this 

These are the error : 

 

D:\arduino-1.8.16\Hydrogen Sensor\DFRobot_OxygenSensor-master\Oxgen_sensorSEN0465\Oxgen_sensorSEN0465.ino:21:3: error: 'DFRobot_GAS_I2C' does not name a type
  DFRobot_GAS_I2C gas(&Wire ,I2C_ADDRESS);
  ^~~~~~~~~~~~~~~
D:\arduino-1.8.16\Hydrogen Sensor\DFRobot_OxygenSensor-master\Oxgen_sensorSEN0465\Oxgen_sensorSEN0465.ino: In function 'void setup()':
D:\arduino-1.8.16\Hydrogen Sensor\DFRobot_OxygenSensor-master\Oxgen_sensorSEN0465\Oxgen_sensorSEN0465.ino:43:10: error: 'gas' was not declared in this scope
  while(!gas.begin())
         ^~~
D:\arduino-1.8.16\Hydrogen Sensor\DFRobot_OxygenSensor-master\Oxgen_sensorSEN0465\Oxgen_sensorSEN0465.ino:50:3: error: 'gas' was not declared in this scope
  gas.changeAcquireMode(gas.PASSIVITY);
  ^~~
D:\arduino-1.8.16\Hydrogen Sensor\DFRobot_OxygenSensor-master\Oxgen_sensorSEN0465\Oxgen_sensorSEN0465.ino: In function 'void loop()':
D:\arduino-1.8.16\Hydrogen Sensor\DFRobot_OxygenSensor-master\Oxgen_sensorSEN0465\Oxgen_sensorSEN0465.ino:59:16: error: 'gas' was not declared in this scope
  Serial.print(gas.queryGasType());
               ^~~

exit status 1

Compilation error: 'DFRobot_GAS_I2C' does not name a type

2023-06-17 01:37:50

Please make sure that you have installed the library correctly DFRobot_MultiGasSensor.h . 

userHeadPic bidrohini.bidrohini
2023-06-16 17:45:41

Hi!

What board are you using?  I use the sample code from the wiki and everything works fine.I can successfully compile this code (using ArduinoIDE 1.8.19) after loading the library.

 

 

 

userHeadPic jenna