Return Arduino String object because of a wierd bug where the char* wasn't passing properly

This commit is contained in:
Robert Marshall 2019-06-15 13:52:14 +01:00
parent 2a0b540a4a
commit 520370fb59
3 changed files with 85 additions and 85 deletions

View file

@ -23,15 +23,15 @@
#define R_PIN D8
#define G_PIN D7
#define B_PIN D6
#define SCL_PIN D1
#define SDA_PIN D4
#define SCL_PIN D4
#define SDA_PIN D1
/*---------------------------+
| Location and time settings |
+---------------------------*/
#define LATITUDE "20.548103"
#define LONGITUDE "96.916835"
#define TIMEZONE_OFFSET 30600 // 8.5 hours in seconds
#define TIMEZONE_OFFSET 28800 // 8 hours in seconds
#define NTP_POOL "uk.pool.ntp.org"
/*============================================================================================================================*/
@ -75,7 +75,7 @@ void setup() {
#endif
#ifdef LED_USE_PWM
_lighting.setupPWM<R_PIN, R_PIN, G_PIN, WHITE_PIN>();
_lighting.setupPWM<R_PIN, G_PIN, B_PIN, WHITE_PIN>();
#endif
_networking.setup();
@ -113,9 +113,9 @@ void doLighting() {
}
void publishTemperature(){
const char *temperature = _sensors.getTemperature();
String temperature = _sensors.getTemperature();
if (temperature != "Pending...")
_networking.publish(TEMPERATURE_TOPIC, temperature, true);
_networking.publish(TEMPERATURE_TOPIC, temperature.c_str(), true);
}
void publishReadings(){