File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -387,8 +387,8 @@ jobs:
387
387
- eval $COMPILE
388
388
- name : " SensorSI7021"
389
389
script :
390
- - wget https://github.com/sparkfun/SparkFun_Si701_Breakout_Arduino_Library /archive/master.zip && unzip master.zip
391
- - sudo cp -r SparkFun_Si701_Breakout_Arduino_Library -master/src /usr/local/share/arduino/libraries
390
+ - wget https://github.com/mysensors/MySensorsArduinoExamples /archive/master.zip && unzip master.zip
391
+ - sudo cp -r MySensorsArduinoExamples -master/libraries/SI7021 /usr/local/share/arduino/libraries
392
392
- sed -r -i 's/\/\/(SensorSI7021 .+)/\1/' $SKETCH
393
393
- sed -r -i 's/\/\/(#include <sensors\/SensorSI7021.h>)/\1/' $SKETCH
394
394
- eval $OTA_CONFIGURATION
Original file line number Diff line number Diff line change @@ -24,11 +24,11 @@ SensorSI7021: temperature and humidity sensor
24
24
*/
25
25
26
26
#include < Wire.h>
27
- #include " SparkFun_Si7021_Breakout_Library.h "
27
+ #include < SI7021.h >
28
28
29
29
class SensorSI7021 : public Sensor {
30
30
protected:
31
- Weather * _si7021;
31
+ SI7021 * _si7021;
32
32
33
33
public:
34
34
SensorSI7021 (uint8_t child_id = 0 ): Sensor(-1 ) {
@@ -40,7 +40,7 @@ class SensorSI7021: public Sensor {
40
40
41
41
// define what to do during setup
42
42
void onSetup () {
43
- _si7021 = new Weather ();
43
+ _si7021 = new SI7021 ();
44
44
_si7021->begin ();
45
45
};
46
46
@@ -49,7 +49,7 @@ class SensorSI7021: public Sensor {
49
49
// temperature sensor
50
50
if (child->getType () == V_TEMP) {
51
51
// read the temperature
52
- float temperature = _si7021->getTemp () ;
52
+ float temperature = ( float ) _si7021->getCelsiusHundredths ()/ 100 ;
53
53
// convert it
54
54
temperature = nodeManager.celsiusToFahrenheit (temperature);
55
55
// store the value
@@ -58,7 +58,7 @@ class SensorSI7021: public Sensor {
58
58
// Humidity Sensor
59
59
else if (child->getType () == V_HUM) {
60
60
// read humidity
61
- float humidity = _si7021->getRH ();
61
+ float humidity = _si7021->getHumidityPercent ();
62
62
// store the value
63
63
child->setValue (humidity);
64
64
}
You can’t perform that action at this time.
0 commit comments