Skip to content

Commit 2dba398

Browse files
committed
Add thanks to in readme. Bump lib ver. touchup ex 3 whitespace.
1 parent 1c918f4 commit 2dba398

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ While the CCS811 requires a burn-in of 48 hours and a run-in of 20 minutes the S
1212
SparkFun labored with love to create this code. Feel like supporting open source hardware?
1313
Buy a [board](https://www.sparkfun.com/products/14813) from SparkFun!
1414

15-
15+
Shout outs to all those folks that have helped make this library better:
16+
17+
* rharkes - PR to fix RHtoAbsolute missing return
18+
* njh - Library link fix
19+
1620
Repository Contents
1721
-------------------
1822

examples/Example3_Humidity/Example3_Humidity.ino

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
Feel like supporting our work? Buy a board from SparkFun!
1111
https://www.sparkfun.com/products/14813
1212
13-
This example gets relative humidity from a sensor, convertts it to absolute humidty,
13+
This example gets relative humidity from a sensor, converts it to absolute humidty,
1414
and updates the SGP30's humidity compensation with the absolute humidity value.
1515
*/
1616

@@ -36,17 +36,23 @@ void setup() {
3636

3737
//Initialize the humidity sensor and ping it
3838
hSensor.begin();
39+
3940
// Measure Relative Humidity from the Si7021
4041
float humidity = hSensor.getRH();
42+
4143
//Measure temperature (in C) from the Si7021
4244
float temperature = hSensor.getTemp();
45+
4346
//Convert relative humidity to absolute humidity
4447
double absHumidity = RHtoAbsolute(humidity, temperature);
48+
4549
//Convert the double type humidity to a fixed point 8.8bit number
4650
uint16_t sensHumidity = doubleToFixedPoint(absHumidity);
51+
4752
//Initializes sensor for air quality readings
4853
//measureAirQuality should be called in one second increments after a call to initAirQuality
4954
mySensor.initAirQuality();
55+
5056
//Set the humidity compensation on the SGP30 to the measured value
5157
//If no humidity sensor attached, sensHumidity should be 0 and sensor will use default
5258
mySensor.setHumidity(sensHumidity);
@@ -56,10 +62,9 @@ void setup() {
5662
void loop() {
5763
//First fifteen readings will be
5864
//CO2: 400 ppm TVOC: 0 ppb
59-
t2 = millis();
60-
if ( t2 >= t1 + 1000) //only will occur if 1 second has passed
65+
if ( millis() >= t1 + 1000) //only will occur if 1 second has passed
6166
{
62-
t1 = t2; //measure CO2 and TVOC levels
67+
t1 = millis(); //measure CO2 and TVOC levels
6368
mySensor.measureAirQuality();
6469
Serial.print("CO2: ");
6570
Serial.print(mySensor.CO2);
@@ -82,5 +87,3 @@ uint16_t doubleToFixedPoint( double number) {
8287
uint16_t value = floor(number2 + 0.5);
8388
return value;
8489
}
85-
86-

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=SparkFun SGP30 Arduino Library
2-
version=1.0.1
2+
version=1.0.2
33
author=SparkFun Electronics
44
maintainer=SparkFun Electronics
55
sentence=Library for the Sensirion SGP30 air quality sensor

0 commit comments

Comments
 (0)