Gas Settings Sample

This application demonstrates manual configuration of the gas resistance reading functions of the module. It uses Arduino IDE's Serial Monitor to display sensor readings.

To run the example:

  1. Open the IoT_Node_Environmental_Gas_Settings sketch from the examples menu.

  2. Select Turta IoT Node from Tools > Board menu.

  3. Select your device's COM port from Tools > Port menu.

  4. Open Serial Monitor from Tools > Serial Monitor.

  5. Select 115.200 baud from the Serial Monitor's status bar.

  6. Upload the code to your device.

Sample Code

IoT_Node_Environmental_Gas_Settings.ino
IoT_Node_Environmental_Gas_Settings.ino
#include <Turta_Environmental_Module.h>
// Create Environmental Sensor instance.
Turta_Environmental_Module en;
void setup() {
// Initialize Environmental Sensor.
// Heat Duration: 150milliseconds, Heat Temperature: 300C
en.beginAdvanced(150, 300);
// Configure serial port.
Serial.begin(115200);
delay(200);
}
void loop() {
// Read gas resistance.
double gasResistance = en.readGasResistance();
Serial.print("Gas Resistance: ");
Serial.println(gasResistance);
// Delay 5000ms = 5 seconds.
delay(5000);
}

Result

After the application is uploaded to the device, it writes current readings to the Serial Monitor every five seconds. The example output should be like this:

Gas Resistance: 121349.56

The application runs forever until you clear it from memory.