Added development sketches for Mics-6815 sensor
This commit is contained in:
parent
111d1c1d6e
commit
2be55da574
3 changed files with 295 additions and 2 deletions
42
MiCS6814-I2C-Tests/MiCS6814-I2C-Tests.ino
Normal file
42
MiCS6814-I2C-Tests/MiCS6814-I2C-Tests.ino
Normal file
|
@ -0,0 +1,42 @@
|
|||
#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:
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue