working xyz accel
Some checks failed
Build / build (macos-12) (push) Waiting to run
Build / build (macos-14) (push) Waiting to run
Build / build (windows-2022) (push) Waiting to run
Build / build (ubuntu-22.04) (push) Failing after 18s
Documentation / build (push) Successful in 5s

This commit is contained in:
2024-04-28 03:03:19 -06:00
parent 60a93c378b
commit 9fc352115f
2 changed files with 40 additions and 11 deletions

View File

@ -154,9 +154,21 @@ static int bmx055_channel_get(const struct device *dev,
val->val2 = 0; // TODO: don't throw out LSB
break;
case SENSOR_CHAN_ACCEL_X:
{
float accel = data->accel_x * 0.00098 * 9.80665; // to gees, to m/s^2
val->val1 = accel;
val->val2 = (accel - val->val1) * 1000000;
break;
}
case SENSOR_CHAN_ACCEL_Y:
return -ENOTSUP;
{
float accel = data->accel_y * 0.00098 * 9.80665; // to gees, to m/s^2
val->val1 = accel;
val->val2 = (accel - val->val1) * 1000000;
break;
}
case SENSOR_CHAN_ACCEL_Z:
{
// For now assume 2g since that's the default value
// 2g 0.98mg/LSB
// 4g 1.95mg/LSB
@ -167,6 +179,7 @@ static int bmx055_channel_get(const struct device *dev,
val->val1 = accel;
val->val2 = (accel - val->val1) * 1000000;
break;
}
case SENSOR_CHAN_GYRO_X:
case SENSOR_CHAN_GYRO_Y:
case SENSOR_CHAN_GYRO_Z: