modm API documentation
|
#include <modm/driver/touch/touch2046.hpp>
Calibration values are used to calculate touch point from raw values.
FactorX and FactorY scaled by 1000000 to avoid float arithmetic. E.g. to get a factor of 0.75 FactorX has to be set to 750'000.
isTouched() = bool(Z > ThresholdZ)
X = (rawX * FactorX / 1000000) + OffsetX limited to [0, MaxX] Y = (rawY * FactorY / 1000000) + OffsetY limited to [0, MaxY]
Orientation (rotation, mirror) are applied after the above operations.