From 3a0d4d14ad4e93fc17de0d2355ad20a39a627d74 Mon Sep 17 00:00:00 2001 From: Daniel Kao Date: Sun, 17 Nov 2019 15:38:16 -0800 Subject: [PATCH] Constrain ANGLE_TUNE setting In case anyone wants to adjust it and doesn't have access to the register definition. --- firmware/production/production.ino | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/firmware/production/production.ino b/firmware/production/production.ino index 1350e0f..56c6a4e 100644 --- a/firmware/production/production.ino +++ b/firmware/production/production.ino @@ -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();