|
14 | 14 | #include "mpu6050.h"
|
15 | 15 | #include "hmc5883l.h"
|
16 | 16 |
|
| 17 | +LOG_MODULE_REGISTER(app); |
| 18 | + |
17 | 19 | /* 1000 msec = 1 sec */
|
18 | 20 | #define SLEEP_TIME_MS 1000
|
19 | 21 |
|
20 | 22 | #define I2C_NODE DT_NODELABEL(i2c0)
|
21 |
| -#define BUTTONS_NODE DT_NODELABEL(button) |
| 23 | +// #define BUTTONS_NODE DT_NODELABEL(button) |
22 | 24 | static const struct device *i2c_dev = DEVICE_DT_GET(I2C_NODE);
|
23 | 25 |
|
24 | 26 | static uint8_t i2c_buf[6];
|
@@ -59,13 +61,17 @@ void main(void) {
|
59 | 61 | // continue;
|
60 | 62 | }
|
61 | 63 |
|
62 |
| - LOG_INF("%f, %f, %f,\n %f, %f, %f,\n %f, %f, %f", |
| 64 | + LOG_INF("acc: %f, %f, %f", |
63 | 65 | (float)(ACC_SCALE_FACTOR)*(int16_t)acc_data[0],
|
64 | 66 | (float)(ACC_SCALE_FACTOR)*(int16_t)acc_data[1],
|
65 |
| - (float)(ACC_SCALE_FACTOR)*(int16_t)acc_data[2], |
| 67 | + (float)(ACC_SCALE_FACTOR)*(int16_t)acc_data[2]); |
| 68 | + |
| 69 | + LOG_INF("gyro: %f, %f, %f", |
66 | 70 | (float)(GYRO_SCALE_FACTOR)*(int16_t)gyro_data[0],
|
67 | 71 | (float)(GYRO_SCALE_FACTOR)*(int16_t)gyro_data[1],
|
68 |
| - (float)(GYRO_SCALE_FACTOR)*(int16_t)gyro_data[2], |
| 72 | + (float)(GYRO_SCALE_FACTOR)*(int16_t)gyro_data[2]); |
| 73 | + |
| 74 | + LOG_INF("mag: %f, %f, %f", |
69 | 75 | (float)(MAG_SCALE_FACTOR)*(int16_t)mag_data[0],
|
70 | 76 | (float)(MAG_SCALE_FACTOR)*(int16_t)mag_data[1],
|
71 | 77 | (float)(MAG_SCALE_FACTOR)*(int16_t)mag_data[2]);
|
|
0 commit comments