Skip to content

Commit

Permalink
add explanatory comments to examples
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-kurka committed May 20, 2021
1 parent 8300cb1 commit 8147c5e
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion lib/ZE14-O3/examples/ze14-hardwareserial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ void setup() {
void loop() {
Serial.print(sensor.getPPM(), 1); // print only one decimal place as that is the resolution of sensor
Serial.println(" ppm");
delay(1100); // if you would read the sensor at intervals less or equal to 1s there would be no message in buffer
delay(1500); // if you would read the sensor at intervals less or equal to 1s there would be no message in buffer
}
6 changes: 3 additions & 3 deletions lib/ZE25-O3/examples/ze25-active_upload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ ZE25 sensor(Serial2); // any uart can be used - Serial, Serial1,

void setup() {
Serial.begin(115200);
sensor.begin(kActiveUpload);
sensor.begin(kActiveUpload); // sets the sensor to active upload mode
}

void loop() {
Serial.println(sensor.getPPM());
delay(1000);
Serial.println(sensor.getPPM()); // prints out the ppm measured by the sensor (by default Serial.print displays float with two decimal which corresponds two sensor resolution)
delay(1500); // if you would read the sensor at intervals less or equal to 1s there would be no message in buffer
}
4 changes: 2 additions & 2 deletions lib/ZE25-O3/examples/ze25-quesstion_answer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ ZE25 sensor(Serial2); // any uart can be used - Serial, Serial1,

void setup() {
Serial.begin(115200);
sensor.begin(kQuestionAnswer);
sensor.begin(kQuestionAnswer); // sets the sensor to question answer mode
}

void loop() {
Serial.println(sensor.getPPM());
Serial.println(sensor.getPPM()); // prints out the ppm measured by the sensor (by default Serial.print displays float with two decimal which corresponds two sensor resolution)
delay(1000);
}
6 changes: 3 additions & 3 deletions lib/ZE25-O3/examples/ze25-softwareserial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ along with Winsen sensors library. If not, see <https://www.gnu.org/licenses/>.
#include <SoftwareSerial.h>
#include <ZE25.h>

SoftwareSerial sw_serial(0, 4);
SoftwareSerial sw_serial(0, 4); // replace the pin numbers to match yours
ZE25 sensor(sw_serial);

void setup() {
Serial.begin(115200);
sensor.begin(kQuestionAnswer);
sensor.begin(kQuestionAnswer); // sets the sensor to question answer mode
}

void loop() {
Serial.println(sensor.getPPM());
Serial.println(sensor.getPPM()); // prints out the ppm measured by the sensor (by default Serial.print displays float with two decimal which corresponds two sensor resolution)
delay(1500);
}
6 changes: 3 additions & 3 deletions lib/ZE27-O3/examples/ze27-active_upload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ ZE27 sensor(Serial2); // any uart can be used - Serial, Serial1,

void setup() {
Serial.begin(115200);
sensor.begin(kActiveUpload);
sensor.begin(kActiveUpload); // sets the sensor to active upload mode
}

void loop() {
Serial.println(sensor.getPPM());
delay(1000);
Serial.println(sensor.getPPM()); // prints out the ppm measured by the sensor (by default Serial.print displays float with two decimal which corresponds two sensor resolution)
delay(1500); // if you would read the sensor at intervals less or equal to 1s there would be no message in buffer
}
4 changes: 2 additions & 2 deletions lib/ZE27-O3/examples/ze27-quesstion_answer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ ZE27 sensor(Serial2); // any uart can be used - Serial, Serial1,

void setup() {
Serial.begin(115200);
sensor.begin(kQuestionAnswer);
sensor.begin(kQuestionAnswer); // sets the sensor to question answer mode
}

void loop() {
Serial.println(sensor.getPPM());
Serial.println(sensor.getPPM()); // prints out the ppm measured by the sensor (by default Serial.print displays float with two decimal which corresponds two sensor resolution)
delay(1000);
}
6 changes: 3 additions & 3 deletions lib/ZE27-O3/examples/ze27-softwareserial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ along with Winsen sensors library. If not, see <https://www.gnu.org/licenses/>.
#include <SoftwareSerial.h>
#include <ZE27.h>

SoftwareSerial sw_serial(0, 4);
SoftwareSerial sw_serial(0, 4); // replace the pin numbers to match yours
ZE27 sensor(sw_serial);

void setup() {
Serial.begin(115200);
sensor.begin(kQuestionAnswer);
sensor.begin(kQuestionAnswer); // sets the sensor to question answer mode
}

void loop() {
Serial.println(sensor.getPPM());
Serial.println(sensor.getPPM()); // prints out the ppm measured by the sensor (by default Serial.print displays float with two decimal which corresponds two sensor resolution)
delay(1500);
}

0 comments on commit 8147c5e

Please sign in to comment.