LinearScaling#
- class LinearScaling(gain: float = 1.0, offset: float = 0.0)[source]#
Bases:
ScalingFunctionLinear scaling:
physical = offset + gain * raw.Example
>>> # Temperature sensor: 0.1°C per count, -40°C offset >>> LinearScaling(gain=0.1, offset=-40.0).to_physical(500) 10.0
Methods
Raw register value → physical units. |
|
Physical value → raw integer. |