Hey there, I am trying to particle.publish a string for my first project using a DHT22
here is an excerpt of my code:
sprintf(publishString,"%.2f,%.2f,%.2f,%.2f",lightAmbient,sensorValue,lightDelta,stand,Temperatur,Luftfeuchtigkeit,Taupunkt);
//Particle.publish("VS",publishString); // I commented the publish for debug reasons
This sprintf creates a string with comma separated values of lightAmbient,sensorValue,lightDelta,stand
As soon as I add more %.2f I get a red SOS error code No1: Hard fault
I also tried %.1f %.0f and %.u
Temperatur,Luftfeuchtigkeit,Taupunkt come from a DHT22:
Luftfeuchtigkeit = dht.getHumidity();
Temperatur = dht.getTempCelcius();
Taupunkt = dht.getDewPoint();
I used Adafruit DHT library since it was the most downloaded
#include <Adafruit_DHT.h>
lightAmbient,sensorValue,lightDelta are float
Adafruit DHT seems to use float too
Any help would be very much appreciated