Skip to content

Commit dda19cd

Browse files
committed
fix(as5600): set angle correctly and log if no magnet
1 parent 78367af commit dda19cd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/components/i2c/drivers/WipperSnapper_I2C_Driver_AS5600.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ class WipperSnapper_I2C_Driver_AS5600 : public WipperSnapper_I2C_Driver {
9999

100100
bool readSensor() {
101101
if (!_as5600->isMagnetDetected()) {
102+
WS_DEBUG_PRINTLN("Magnet not detected!");
102103
return false;
103104
}
104105

@@ -125,6 +126,7 @@ class WipperSnapper_I2C_Driver_AS5600 : public WipperSnapper_I2C_Driver {
125126
WS_DEBUG_PRINTLN(" | ML: magnet too weak");
126127
return false;
127128
}
129+
_angle = (float)angle;
128130
return true;
129131
}
130132

0 commit comments

Comments
 (0)