Skip to content

Commit 363d58d

Browse files
Rocketctsandeepmistry
authored andcommitted
first commit
0 parents  commit 363d58d

File tree

9 files changed

+491
-0
lines changed

9 files changed

+491
-0
lines changed

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 - ????.??.??
4+
5+
* Initial release

README.adoc

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
= LSM6DS3 Library for Arduino =
2+
3+
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.
4+
5+
For more information about this library please visit us at https://www.arduino.cc/en/Reference/Arduino_LSM6DS3
6+
7+
== License ==
8+
9+
Copyright (c) 2019 Arduino SA. All rights reserved.
10+
11+
This library is free software; you can redistribute it and/or
12+
modify it under the terms of the GNU Lesser General Public
13+
License as published by the Free Software Foundation; either
14+
version 2.1 of the License, or (at your option) any later version.
15+
16+
This library is distributed in the hope that it will be useful,
17+
but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19+
Lesser General Public License for more details.
20+
21+
You should have received a copy of the GNU Lesser General Public
22+
License along with this library; if not, write to the Free Software
23+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
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_LSM6DS3.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_LSM6DS3.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_LSM6DS3
3+
#######################################
4+
# Class
5+
#######################################
6+
7+
Arduino_LSM6DS3 KEYWORD1
8+
LSM6DS3 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_LSM6DS3
2+
version=0.0.0
3+
author=Arduino
4+
maintainer=Arduino <info@arduino.cc>
5+
sentence=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.
6+
paragraph=
7+
category=Sensors
8+
url=https://www.arduino.cc/en/Reference/Arduino_LSM6DS3
9+
architectures=*
10+
includes=Arduino_LSM6DS3.h

src/Arduino_LSM6DS3.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) 2019 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_LSM6DS3_H_
21+
#define _ARUDINO_LSM6DS3_H_
22+
23+
#include "LSM6DS3.h"
24+
25+
#endif

0 commit comments

Comments
 (0)