initialize sensor objects in constructor
This commit is contained in:
parent
4dbc5b186c
commit
c5bad1cc44
|
@ -5,7 +5,7 @@
|
|||
|
||||
Sensor_BH1750::Sensor_BH1750()
|
||||
{
|
||||
BH1750 bh1750(0x23); //0x23 if addr connected to ground (=pin open), 0x5c if addr pulled high
|
||||
bh1750 = new BH1750(0x23); //0x23 if addr connected to ground (=pin open), 0x5c if addr pulled high
|
||||
}
|
||||
|
||||
void Sensor_BH1750::init() //Things to be done during setup()
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
Sensor_BMP180::Sensor_BMP180()
|
||||
{
|
||||
Adafruit_BMP085 bmp180;
|
||||
bmp180 = new Adafruit_BMP085();
|
||||
}
|
||||
|
||||
void Sensor_BMP180::init() //Things to be done during setup()
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
Sensor_HTU21D::Sensor_HTU21D()
|
||||
{
|
||||
Adafruit_HTU21DF htu;
|
||||
htu = new Adafruit_HTU21DF();
|
||||
}
|
||||
|
||||
void Sensor_HTU21D::init() //Things to be done during setup()
|
||||
|
|
|
@ -7,6 +7,9 @@ Sensor_MHZ19B::Sensor_MHZ19B(int prx,int ptx)
|
|||
pin_rx=prx;
|
||||
pin_tx=ptx;
|
||||
|
||||
mhz19 = new MHZ19();
|
||||
mhz19_swSerial = new SoftwareSerial();
|
||||
|
||||
/*
|
||||
* MHZ19 Library: https://platformio.org/lib/show/1620/SevSegSPI
|
||||
* Software Serial Library: https://platformio.org/lib/show/168/EspSoftwareSerial
|
||||
|
|
|
@ -25,7 +25,6 @@ private:
|
|||
int mhz19_readValue_reimplemented(Stream *_streamRef, MHZ19 *_mhz19Ref);
|
||||
byte mhz19_getCheckSum(byte* packet);
|
||||
|
||||
|
||||
bool mhz19_ready;
|
||||
|
||||
MHZ19 *mhz19;
|
||||
|
|
|
@ -10,6 +10,8 @@ Sensor_SDS018::Sensor_SDS018(int prx,int ptx)
|
|||
{
|
||||
pin_rx=prx;
|
||||
pin_tx=ptx;
|
||||
|
||||
sds018_swSerial = new SoftwareSerial();
|
||||
}
|
||||
|
||||
void Sensor_SDS018::init() //Things to be done during setup()
|
||||
|
|
Loading…
Reference in New Issue