Код: Выделить всё
//модуль давления воды
#ifdef PRESSURE_FEATURE
#define SENSOR A2//the YELLOW pin of the Sensor is connected with A2 of Arduino/Catduino
char buffer_kPa[10];
char buffer_bar[10];
void pressureInit() {
}
void pressureWorks(){
if(cycle20s){
int raw = analogRead(SENSOR);
float voltage = (float) raw * 5.0 / 1024.0; // voltage at the pin of the Arduino
float pressure_kPa = (voltage - 0.5) / 4.0 * 1100.0 * 10; // voltage to pressure
float pressure_bar = pressure_kPa * 0.001; // kPa to bar
timeStamp();
Serial.print(pressure_bar);
Serial.println(" bar");
#ifdef MAJORDOMO_FEATURE
//sendRequestM("Давление котла", pressure_bar);
sendReqSensorFloatM("Давление котла", pressure_bar);
#endif
}
}
#endif
Код: Выделить всё
2018-10-02 00:33:10 2.21 bar
2018-10-02 00:33:10 Host 192.168.1.100 GET /objects/?object=Давление котла&op=m&m=update&v=? HTTP/1.0
Если расскоментировать строку sendRequestM то вместо знака вопроса уходит целое число до запятой, а хотелось бы дробное.
В чем заковыка?