File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
examples/RTU/ModbusRTUTemperatureSensor Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -48,14 +48,14 @@ void loop() {
4848 Serial.println (ModbusRTUClient.lastError ());
4949 } else {
5050
51- // If the request goes fine, the sensor sent the readings as bytes packet,
52- // through the read() function is possible read the measurments.
53- // the readings is parsed as a short integer from the packets
51+ // If the request goes fine, the sensor sends the readings, this are
52+ // stored in the holding register and through the read() function is
53+ // possible get the temperature and the humidity as raw values.
5454 short rawtemperature = ModbusRTUClient.read ();
5555 short rawhumidity = ModbusRTUClient.read ();
5656
57- // Is required divide by 10.0 the value readed, because the sensor sent the
58- // readings as an integer obtained multipling the float value readed by 10
57+ // Is required divide by 10.0 the raw value to get the temperature in Celsius
58+ // and the humidity reading as a percentage.
5959 temperature = rawtemperature / 10.0 ;
6060 humidity = rawhumidity / 10.0 ;
6161 Serial.println (temperature);
You can’t perform that action at this time.
0 commit comments