Constrain ANGLE_TUNE setting

In case anyone wants to adjust it and doesn't have access to the register definition.
This commit is contained in:
Daniel Kao 2019-11-17 15:38:16 -08:00 committed by PloopyCo
parent 92070e143d
commit fc9cd621b1
1 changed files with 2 additions and 1 deletions

View File

@ -318,7 +318,8 @@ void initialisePMW3360(void) {
// Rotate the x and y results, since the sensor isn't quite squared up in
// the enclosure.
adnsWriteReg(ANGLE_TUNE, ROTATIONAL_TRANSFORM_ANGLE);
// Sensor rotates up to +/-30 degrees
adnsWriteReg(ANGLE_TUNE, constrain(ROTATIONAL_TRANSFORM_ANGLE, -30, 30));
adnsComEnd();