42 lines
948 B
C++
42 lines
948 B
C++
#include <MiCS6814-I2C.h>
|
|
|
|
MiCS6814 sensor;
|
|
|
|
void setup() {
|
|
Serial.begin(115200);
|
|
if (sensor.begin()) {
|
|
sensor.powerOn();
|
|
|
|
Serial.println("Current base resistances:");
|
|
Serial.print("NH3: ");
|
|
Serial.print(sensor.getBaseResistance(CH_NH3));
|
|
Serial.print("\tRED: ");
|
|
Serial.print(sensor.getBaseResistance(CH_RED));
|
|
Serial.print("\tOX: ");
|
|
Serial.println(sensor.getBaseResistance(CH_OX));
|
|
|
|
Serial.println("---");
|
|
|
|
Serial.println("Starting calibration");
|
|
sensor.calibrate();
|
|
|
|
Serial.println("Calibration done");
|
|
Serial.println("New base resistances:");
|
|
Serial.print("NH3: ");
|
|
Serial.print(sensor.getBaseResistance(CH_NH3));
|
|
Serial.print("\tRED: ");
|
|
Serial.print(sensor.getBaseResistance(CH_RED));
|
|
Serial.print("\tOX: ");
|
|
Serial.println(sensor.getBaseResistance(CH_OX));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
void loop() {
|
|
// put your main code here, to run repeatedly:
|
|
|
|
}
|