Skip to content

Commit 4aab576

Browse files
committed
Initial commit based on Arduino_LSM6DS3
0 parents  commit 4aab576

File tree

11 files changed

+991
-0
lines changed

11 files changed

+991
-0
lines changed

.codespellrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# See: https://github.com/codespell-project/codespell#using-a-config-file
2+
[codespell]
3+
# In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here:
4+
ignore-words-list = ,
5+
check-filenames =
6+
check-hidden =
7+
skip = ./.git

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Arduino_LSM6DSM ?.?.? - ????.??.??
2+
3+
Arduino_LSM6DSM 1.0.0 - 2019.07.19
4+
5+
* Initial release

LICENSE.txt

Lines changed: 504 additions & 0 deletions
Large diffs are not rendered by default.

README.adoc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
:repository-owner: arduino-libraries
2+
:repository-name: Arduino_LSM6DS3
3+
4+
= {repository-name} Library for Arduino =
5+
6+
image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-arduino.yml/badge.svg["Check Arduino status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-arduino.yml"]
7+
image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/compile-examples.yml/badge.svg["Compile Examples status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/compile-examples.yml"]
8+
image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check.yml/badge.svg["Spell Check status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check.yml"]
9+
10+
Allows you to read the accelerometer and gyroscope values from the LSM6DS3 IMU on your Arduino Nano 33 IoT or Arduino Uno WiFi Rev2 boards.
11+
12+
For more information about this library please visit us at https://www.arduino.cc/en/Reference/{repository-name}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
Arduino LSM6DS3 - Simple Accelerometer
3+
4+
This example reads the acceleration values from the LSM6DS3
5+
sensor and continuously prints them to the Serial Monitor
6+
or Serial Plotter.
7+
8+
The circuit:
9+
- Arduino Uno WiFi Rev 2 or Arduino Nano 33 IoT
10+
11+
created 10 Jul 2019
12+
by Riccardo Rizzo
13+
14+
This example code is in the public domain.
15+
*/
16+
17+
#include <Arduino_LSM6DSOX.h>
18+
19+
void setup() {
20+
Serial.begin(9600);
21+
while (!Serial);
22+
23+
if (!IMU.begin()) {
24+
Serial.println("Failed to initialize IMU!");
25+
26+
while (1);
27+
}
28+
29+
Serial.print("Accelerometer sample rate = ");
30+
Serial.print(IMU.accelerationSampleRate());
31+
Serial.println(" Hz");
32+
Serial.println();
33+
Serial.println("Acceleration in g's");
34+
Serial.println("X\tY\tZ");
35+
}
36+
37+
void loop() {
38+
float x, y, z;
39+
40+
if (IMU.accelerationAvailable()) {
41+
IMU.readAcceleration(x, y, z);
42+
43+
Serial.print(x);
44+
Serial.print('\t');
45+
Serial.print(y);
46+
Serial.print('\t');
47+
Serial.println(z);
48+
}
49+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
Arduino LSM6DS3 - Simple Gyroscope
3+
4+
This example reads the gyroscope values from the LSM6DS3
5+
sensor and continuously prints them to the Serial Monitor
6+
or Serial Plotter.
7+
8+
The circuit:
9+
- Arduino Uno WiFi Rev 2 or Arduino Nano 33 IoT
10+
11+
created 10 Jul 2019
12+
by Riccardo Rizzo
13+
14+
This example code is in the public domain.
15+
*/
16+
17+
#include <Arduino_LSM6DSOX.h>
18+
19+
void setup() {
20+
Serial.begin(9600);
21+
while (!Serial);
22+
23+
if (!IMU.begin()) {
24+
Serial.println("Failed to initialize IMU!");
25+
26+
while (1);
27+
}
28+
29+
Serial.print("Gyroscope sample rate = ");
30+
Serial.print(IMU.gyroscopeSampleRate());
31+
Serial.println(" Hz");
32+
Serial.println();
33+
Serial.println("Gyroscope in degrees/second");
34+
Serial.println("X\tY\tZ");
35+
}
36+
37+
void loop() {
38+
float x, y, z;
39+
40+
if (IMU.gyroscopeAvailable()) {
41+
IMU.readGyroscope(x, y, z);
42+
43+
Serial.print(x);
44+
Serial.print('\t');
45+
Serial.print(y);
46+
Serial.print('\t');
47+
Serial.println(z);
48+
}
49+
}

keywords.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#######################################
2+
# Syntax Coloring Map For Arduino_LSM6DSOX
3+
#######################################
4+
# Class
5+
#######################################
6+
7+
Arduino_LSM6DSOX KEYWORD1
8+
LSM6DSOX KEYWORD1
9+
IMU KEYWORD1
10+
11+
#######################################
12+
# Methods and Functions
13+
#######################################
14+
15+
begin KEYWORD2
16+
end KEYWORD2
17+
18+
readAcceleration KEYWORD2
19+
readGyroscope KEYWORD2
20+
gyroscopeAvailable KEYWORD2
21+
accelerationAvailable KEYWORD2
22+
accelerationSampleRate KEYWORD2
23+
gyroscopeSampleRate KEYWORD2
24+
25+
#######################################
26+
# Constants
27+
#######################################

library.properties

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name=Arduino_LSM6DSOX
2+
version=1.0.0
3+
author=Arduino
4+
maintainer=Arduino <info@arduino.cc>
5+
sentence=Allows you to read the accelerometer and gyroscope values from the LSM6DSOX IMU on your Arduino Nano RP2040 Connect.
6+
paragraph=
7+
category=Sensors
8+
url=https://www.arduino.cc/en/Reference/Arduino_LSM6DSOX
9+
architectures=*
10+
includes=Arduino_LSM6DSOX.h

src/Arduino_LSM6DSOX.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
This file is part of the Arduino_LSM6DS3 library.
3+
Copyright (c) 2021 Arduino SA. All rights reserved.
4+
5+
This library is free software; you can redistribute it and/or
6+
modify it under the terms of the GNU Lesser General Public
7+
License as published by the Free Software Foundation; either
8+
version 2.1 of the License, or (at your option) any later version.
9+
10+
This library is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
Lesser General Public License for more details.
14+
15+
You should have received a copy of the GNU Lesser General Public
16+
License along with this library; if not, write to the Free Software
17+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
19+
20+
#ifndef _ARUDINO_LSM6DSOX_H_
21+
#define _ARUDINO_LSM6DSOX_H_
22+
23+
#include "LSM6DSOX.h"
24+
25+
#endif

0 commit comments

Comments
 (0)