Skip to content

Commit e9a16f3

Browse files
committed
fix wrong gyro units - updated example output and add actions
1 parent c481870 commit e9a16f3

File tree

4 files changed

+38
-6
lines changed

4 files changed

+38
-6
lines changed

.github/workflows/githubci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Arduino Library CI
2+
3+
on: [pull_request, push, repository_dispatch]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/setup-python@v1
11+
with:
12+
python-version: '3.x'
13+
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v2
15+
with:
16+
repository: adafruit/ci-arduino
17+
path: ci
18+
19+
- name: pre-install
20+
run: bash ci/actions_install.sh
21+
22+
- name: test platforms
23+
run: python3 ci/build_platform.py main_platforms
24+
25+
- name: clang
26+
run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r .
27+
28+
- name: doxygen
29+
env:
30+
GH_REPO_TOKEN: ${{ secrets.GH_REPO_TOKEN }}
31+
PRETTYNAME : "Adafruit LSM9DS1 Library"
32+
run: bash ci/doxy_gen_and_deploy.sh

Adafruit_LSM9DS0.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,9 +486,9 @@ void Adafruit_LSM9DS0::getGyroEvent(sensors_event_t* event, uint32_t timestamp)
486486
event->sensor_id = _lsm9dso_sensorid_accel;
487487
event->type = SENSOR_TYPE_GYROSCOPE;
488488
event->timestamp = timestamp;
489-
event->gyro.x = gyroData.x * _gyro_dps_digit;
490-
event->gyro.y = gyroData.y * _gyro_dps_digit;
491-
event->gyro.z = gyroData.z * _gyro_dps_digit;
489+
event->gyro.x = gyroData.x * _gyro_dps_digit * SENSORS_DPS_TO_RADS;
490+
event->gyro.y = gyroData.y * _gyro_dps_digit * SENSORS_DPS_TO_RADS;
491+
event->gyro.z = gyroData.z * _gyro_dps_digit * SENSORS_DPS_TO_RADS;
492492
}
493493

494494
void Adafruit_LSM9DS0::getTempEvent(sensors_event_t* event, uint32_t timestamp) {

examples/sensorapi/sensorapi.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,12 @@ void loop(void)
188188
// print out magnetometer data
189189
Serial.print("Magn. X: "); Serial.print(mag.magnetic.x); Serial.print(" ");
190190
Serial.print(" \tY: "); Serial.print(mag.magnetic.y); Serial.print(" ");
191-
Serial.print(" \tZ: "); Serial.print(mag.magnetic.z); Serial.println(" \tgauss");
191+
Serial.print(" \tZ: "); Serial.print(mag.magnetic.z); Serial.println(" \tuT");
192192

193193
// print out gyroscopic data
194194
Serial.print("Gyro X: "); Serial.print(gyro.gyro.x); Serial.print(" ");
195195
Serial.print(" \tY: "); Serial.print(gyro.gyro.y); Serial.print(" ");
196-
Serial.print(" \tZ: "); Serial.print(gyro.gyro.z); Serial.println(" \tdps");
196+
Serial.print(" \tZ: "); Serial.print(gyro.gyro.z); Serial.println(" \trad/s");
197197

198198
// print out temperature data
199199
Serial.print("Temp: "); Serial.print(temp.temperature); Serial.println(" *C");

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Adafruit LSM9DS0 Library
2-
version=1.0.4
2+
version=2.0.0
33
author=Adafruit
44
maintainer=Adafruit <[email protected]>
55
sentence=Arduino library for LSM9DS0 9-DOF sensor board.

0 commit comments

Comments
 (0)