Also, it'd be a good idea to add some length specifiers to your sprintfs, something like:
Code: Select all
sprintf(hum,"analog_actuator=%6.1g",localHum);
Moderators: adafruit_support_bill, adafruit
Code: Select all
sprintf(hum,"analog_actuator=%6.1g",localHum);
You don't call it explicitly, but you do set it up to be (potentially) called by the underlying library:Anyway the callback function is not called in my test demo
Code: Select all
client.setCallback(callback);
Code: Select all
sprintf(hum,"analog_actuator=%g",localHum);
Serial.println(hum);
Code: Select all
sprintf(hum,"analog_actuator=%g",localHum);
Serial.print(localHum); Serial.print(", "); Serial.println(hum);
Code: Select all
Publishing to J
analog_actuator=51.3, 51.30
analog_actuator=25.7, 25.70
Publishing to J
analog_actuator=35.5, 35.50
analog_actuator=-25.2, -25.20
Publishing to J
analog_actuator=48.3, 48.30
analog_actuator=25.2, 25.20
Publishing to J
analog_actuator=48.3, 48.30
analog_actuator=25.2, 25.20
Publishing to J
analog_actuator=48.3, 48.30
analog_actuator=25.2, 25.20
Publishing to J
analog_actuator=48.3, 48.30
analog_actuator=25.2, 25.20
Publishing to J
analog_actuator=48.3, 48.30
analog_actuator=25.2, 25.20
Publishing to J
analog_actuator=36.1, 36.10
analog_actuator=25.2, 25.20
Publishing to J
analog_actuator=36.1, 36.10
analog_actuator=25.2, 25.20
Publishing to J
analog_actuator=36.1, 36.10
analog_actuator=12.4, 12.40
Publishing to J
analog_actuator=36.1, 36.10
analog_actuator=12.4, 12.40
Publishing to J
analog_actuator=36.1, 36.10
analog_actuator=12.4, 12.40
I just hooked it up backwards. I'm trying it out on different boards and when I was swapping back I flipped it so GND went to VCC and vice versa. It didn't like that. :(no problem. But tell, how did you manage to fried the DHT22? :) Could be interesting story anyway.