File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
src/components/i2c/drivers Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,8 @@ bool WipperSnapper_I2C_Driver_QMC5883P::begin() {
33
33
_qmc->setOSR (QMC5883P_OSR_4);
34
34
// Set DSR (Downsample Ratio) to 2
35
35
_qmc->setDSR (QMC5883P_DSR_2);
36
- // Set Range to 8G
37
- _qmc->setRange (QMC5883P_RANGE_8G );
36
+ // Set Range to 30G
37
+ _qmc->setRange (QMC5883P_RANGE_30G );
38
38
// Set SetReset mode to On
39
39
_qmc->setSetResetMode (QMC5883P_SETRESET_ON);
40
40
@@ -51,12 +51,21 @@ bool WipperSnapper_I2C_Driver_QMC5883P::getEventRaw(sensors_event_t *magEvent) {
51
51
52
52
// Get raw magnetic data
53
53
if (!_qmc->getRawMagnetic (&x, &y, &z)) {
54
+ WS_DEBUG_PRINTLN (" Failed to read raw magnetic data" );
54
55
return false ;
55
56
}
56
57
57
58
// Get Gauss field data
58
59
if (!_qmc->getGaussField (&gx, &gy, &gz)) {
60
+ WS_DEBUG_PRINTLN (" Failed to read Gauss field data" );
61
+ WS_DEBUG_PRINT (" Raw X: " ); WS_DEBUG_PRINTLN (x);
62
+ WS_DEBUG_PRINT (" Raw Y: " ); WS_DEBUG_PRINTLN (y);
63
+ WS_DEBUG_PRINT (" Raw Z: " ); WS_DEBUG_PRINTLN (z);
59
64
return false ;
65
+ } else {
66
+ WS_DEBUG_PRINT (" Gauss X: " ); WS_DEBUG_PRINTLN (gx);
67
+ WS_DEBUG_PRINT (" Gauss Y: " ); WS_DEBUG_PRINTLN (gy);
68
+ WS_DEBUG_PRINT (" Gauss Z: " ); WS_DEBUG_PRINTLN (gz);
60
69
}
61
70
62
71
// Check for overflow
You can’t perform that action at this time.
0 commit comments