I've noticed an issue when pitching forward or backward. I expect only the "up" or "down" directions to be registered, but instead, "left" and/or "right" are also triggered for a brief period.
The SENSOR_CENTERED is 0, so at the end we just return 0 if button not yet triggered while we change direction, otherwise it can crash as it's a non-void function.
Anyway that's what I use for a week and it works for me.
I've noticed an issue when pitching forward or backward. I expect only the "up" or "down" directions to be registered, but instead, "left" and/or "right" are also triggered for a brief period.
The SENSOR_CENTERED is 0, so at the end we just return 0 if button not yet triggered while we change direction, otherwise it can crash as it's a non-void function.
Anyway that's what I use for a week and it works for me.