I'm trying to read the current setpoint shift from my knx thermostat. It is returned as a single byte, which seems to be mapped as follows:
byte = 0 - > 0°
byte = 1 -> +0.1°
byte = 2 -> +0.2°
...
For negative adjustments, it goes like this:
byte = 255 -> -0.1°
byte = 254 -> -0.2°
...
So I have the byte. But I cannot seem to get it to calculate correctly to do the mapping. My first idea was this:
-
if-block (byte<=128) -> scaler block (parameters 0,0,1,0.1)
if-block (byte>128) -> scaler block (parameters 255,-0.1,254,-0.2)
-
But for the second part, it gives the wrong result. Simple subtraction also fails:
-
(byte, constant 255) -> subtract
-
returns -1 if the byte = 254, but also returns -1 if it is 253, 252, ... etc.
What am I missing here...?
Thanks,
Jörg
Kommentar