File tree Expand file tree Collapse file tree 1 file changed +27
-2
lines changed Expand file tree Collapse file tree 1 file changed +27
-2
lines changed Original file line number Diff line number Diff line change 1
1
#include " Wire.h"
2
2
#include < vector>
3
3
#include < VL53L1X.h> // from Poulou
4
- #include < Arduino_APDS9960.h>
5
4
#include " Arduino_BMI270_BMM150.h"
6
5
#include < Arduino_LPS22HB.h>
7
6
#include < Arduino_HS300x.h>
@@ -364,7 +363,33 @@ class ModulinoMovement : public Module {
364
363
int initialized = 0 ;
365
364
};
366
365
367
- class ModulinoAir : public Module {
366
+ class ModulinoThermo : public Module {
367
+ public:
368
+ bool begin () {
369
+ if (_sensor == nullptr ) {
370
+ _sensor = new HS300xClass (*((TwoWire*)getWire ()));
371
+ }
372
+ initialized = _sensor->begin ();
373
+ return initialized;
374
+ }
375
+ float getHumidity () {
376
+ if (initialized) {
377
+ return _sensor->readHumidity ();
378
+ }
379
+ return 0 ;
380
+ }
381
+ float getTemperature () {
382
+ if (initialized) {
383
+ return _sensor->readTemperature ();
384
+ }
385
+ return 0 ;
386
+ }
387
+ private:
388
+ HS300xClass* _sensor = nullptr ;
389
+ int initialized = 0 ;
390
+ };
391
+
392
+ class ModulinoPressure : public Module {
368
393
public:
369
394
bool begin () {
370
395
if (_barometer == nullptr ) {
You can’t perform that action at this time.
0 commit comments