Compact some code

This commit is contained in:
Mathieu Maret 2016-06-01 00:44:14 +02:00
parent 26d3deee0e
commit 85f0bf5c78

View File

@ -265,17 +265,11 @@ void loop() {
nbCycle++; nbCycle++;
if (nbCycle > CONFIG_SAMPLING_PERIODE_MS / CONFIG_WEB_DELAY_MS) { if (nbCycle > CONFIG_SAMPLING_PERIODE_MS / CONFIG_WEB_DELAY_MS) {
if (BMP180GetTempAndPressure(temp, pressure) == 0) { if (BMP180GetTempAndPressure(temp, pressure) == 0) {
SKETCH_DEBUG_PRINT("Current T°C "); SKETCH_DEBUG_PRINTF("Current T°C %f Pressure %f\n", temp, pressure);
SKETCH_DEBUG_PRINT(temp);
SKETCH_DEBUG_PRINT(" Pressure mB ");
SKETCH_DEBUG_PRINTLN(pressure);
MqttPublish(temp, pressure); MqttPublish(temp, pressure);
} }
if (DHTGetTempAndHumidity(dhtTemp, dhtHumidity) == 0) { if (DHTGetTempAndHumidity(dhtTemp, dhtHumidity) == 0) {
SKETCH_DEBUG_PRINT("Current T°C "); SKETCH_DEBUG_PRINTF("Current T°C %f Humidity %f\n", dhtTemp, dhtHumidity);
SKETCH_DEBUG_PRINT(dhtTemp);
SKETCH_DEBUG_PRINT(" Humidity ");
SKETCH_DEBUG_PRINTLN(dhtHumidity);
MqttDhtPublish(dhtTemp, dhtHumidity); MqttDhtPublish(dhtTemp, dhtHumidity);
} }
nbCycle = 0; nbCycle = 0;