Hello,
I have a Core and now a Photon as well. I have a working code on the Core for DHT22 to get the temp and hum data.
However, flash the same code and hook up the DHT22 to the Photon, I cannot get any data…
It is hooked up to D3, gnd and 3v3 pins.
Any idea? The code should work from Core on Photon as well as far as I know, right? or do I miss something ?
Many thanks in advance,
Algo
This code works on the Photon without any issues and it’s non-blocking
2 Likes
Thanks for the reply. I am using this code, which is perfectly fine on core, but not delivering values from photon
Are you sure its not this issue :
Hi,
I’m trying to convert a float to a string so I can publish temperatures to Spark.
However, it seems that sprintf will convert the number as a null. Searching this forum seems to indicate that this should work. Casting the variable as an int also works so it appears to be an issue with floats/double.
##Sample code
void setup() {
Serial.begin(9600);
}
void loop() {
delay(2000);
char t1[20];
sprintf(t1, "Value: %.02", (double) 55.21);
Serial.println(t1);
Spark.pub…
That's the reason my DHT22 is not reporting values right now.
Moors7
August 23, 2015, 11:25pm
5
Try printing the values over serial, and see if that works for you? If so, then there’s likely another issue, whereby the one pointed out by @Rockvole is the best contender.
This will be the issue, because i try to convert float to string and i get null. Thank you very much!!!
mdma
August 24, 2015, 6:25am
8
Sorry about the float to string conversion in sprintf not working. Please see this thread for whent he fix is available and a workaround.
I’m sorry this managed to work it’s way out of the 0.4.4 release. I’ve definitely fixed this and added an automated test so this shouldn’t happen again. The issue is here - https://github.com/spark/firmware/issues/576
The fix is in develop now, and will be rolled out with 0.4.5 Wednesday next week (2 Sept.)