fix newline
This commit is contained in:
parent
85196faccd
commit
b48eda46de
2 changed files with 2 additions and 2 deletions
|
@ -112,7 +112,7 @@ int getdhtstring(int PIN, char* string)
|
||||||
temp *= -1.0f;
|
temp *= -1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(string, "{\"humidity\": %.1f, \"temp\": %.1f}\n", humid, temp);
|
sprintf(string, "{\"humidity\": %.1f, \"temp\": %.1f}", humid, temp);
|
||||||
|
|
||||||
gpio_close(handle);
|
gpio_close(handle);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -44,7 +44,7 @@ int main(int argc, char *argv[])
|
||||||
char *dhtstring = static_cast<char*>(malloc(512));
|
char *dhtstring = static_cast<char*>(malloc(512));
|
||||||
int result = getdhtstring(PIN, dhtstring);
|
int result = getdhtstring(PIN, dhtstring);
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
dhtJson = QByteArray(dhtstring).trimmed();
|
dhtJson = QByteArray(dhtstring);
|
||||||
}
|
}
|
||||||
free(dhtstring);
|
free(dhtstring);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue