diff --git a/examples/knx-bme680/knx-bme680.ino b/examples/knx-bme680/knx-bme680.ino index 3342d26..465f4cd 100644 --- a/examples/knx-bme680/knx-bme680.ino +++ b/examples/knx-bme680/knx-bme680.ino @@ -58,8 +58,10 @@ void setup(void) if(knx.configured()) goTriggerSample.callback(triggerCallback); - // depends on sensor board. Try BME680_I2C_ADDR_PRIMARY if it doen't work. + // Configure Wire pins before this call if needed. + Wire.begin(); + // depends on sensor board. Try BME680_I2C_ADDR_PRIMARY if it doen't work. iaqSensor.begin(BME680_I2C_ADDR_SECONDARY, Wire); checkIaqSensorStatus(); diff --git a/src/knx/knx_value.cpp b/src/knx/knx_value.cpp index f9b8954..4985085 100644 --- a/src/knx/knx_value.cpp +++ b/src/knx/knx_value.cpp @@ -528,4 +528,20 @@ struct tm KNXValue::timeValue() const } struct tm tmp; return tmp; +} + +KNXValue::KNXValue(float value) +{ +} + +KNXValue& KNXValue::operator=(const float value) +{ + _value.doubleValue = value; + _type = DoubleType; + return *this; +} + +KNXValue::operator float() const +{ + return doubleValue(); } \ No newline at end of file diff --git a/src/knx/knx_value.h b/src/knx/knx_value.h index d03f804..e0e5792 100644 --- a/src/knx/knx_value.h +++ b/src/knx/knx_value.h @@ -18,6 +18,7 @@ class KNXValue KNXValue(double value); KNXValue(const char* value); KNXValue(struct tm value); + KNXValue(float value); operator bool() const; operator uint8_t() const; @@ -31,6 +32,7 @@ class KNXValue operator double() const; operator const char*() const; operator struct tm() const; + operator float() const; KNXValue& operator=(const bool value); KNXValue& operator=(const uint8_t value); @@ -44,6 +46,8 @@ class KNXValue KNXValue& operator=(const double value); KNXValue& operator=(const char* value); KNXValue& operator=(const struct tm value); + KNXValue& operator=(const float value); + private: bool boolValue() const; @@ -88,7 +92,7 @@ class KNXValue LongType, DoubleType, StringType, - TimeType + TimeType, }; ValueType _type; diff --git a/visualstudio/knx-bme680.vgdbproj b/visualstudio/knx-bme680.vgdbproj index 5e13a48..2998acb 100644 --- a/visualstudio/knx-bme680.vgdbproj +++ b/visualstudio/knx-bme680.vgdbproj @@ -224,6 +224,7 @@ esp8266:esp8266:nodemcuv2 + COM4 @@ -240,7 +241,7 @@ ssl - all + basic eesz