Library to use Winston ZE03 sensor series.
The library includes two modes: an active mode and a Question and answer mode.
To use the question an answer mode (for an Arduino MEGA):
#include <WinsenZE03.h>
WinsenZE03 sensor;
void setup() {
Serial3.begin(9600); // Initialize the Serial port
sensor.begin(&Serial3, CO); // Init the sensor, don't forget the "&"
sensor.setAs(QA); // use ACTIVE, for the active mode
Serial.begin(9600);
}
void loop() {
float ppm = sensor.readManual(); //Read the sensor
Serial.println(ppm);
}
Initialize the sensor to listen the Serial provided, the following types are supported:
CO, SO2, NO2, O2, NH3, H2S, HF, CL2 and O3
Sets the sensor to Active .setAs(ACTIVE)
or Question and Answer mode .setAs(QA)
Reads the sensor in QA mode and returns a Float with the result, if the read process suffers a problem, it returns -1
Reads the sensor in active mode and returns a Float with the result if Serial data is available, if the read process suffers a problem, it returns -1
MIT © Fabian Enrique Gutierrez