You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/hardware/05.nicla/boards/nicla-vision/tutorials/nicla-vision-imu/content.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,15 +20,15 @@ software:
20
20
21
21
## Overview
22
22
23
-
In this tutorial, we will learn how to access the gyroscope and accelerometer that is on the Nicla Vision board. For this, we will be using the [Arduino_LSMDS63](https://www.arduino.cc/en/Reference/ArduinoLSM6DSOX) library and the Arduino IDE. Printing the values in the serial monitor of the Arduino IDE.
23
+
In this tutorial, you will learn how to access the gyroscope and accelerometer that are placed on the Nicla Vision board. For this, you will be using the [Arduino_LSMDS63](https://www.arduino.cc/en/Reference/ArduinoLSM6DSOX) library and the Arduino IDE, printing the values in the Serial Monitor of the Arduino IDE.
24
24
25
25
## Goals
26
26
27
27
The goals of this project are:
28
28
29
-
- Read accelerometer data.
30
-
- Read gyroscope data.
31
-
- Print the data in the Serial Monitor.
29
+
- Read accelerometer data
30
+
- Read gyroscope data
31
+
- Print the data in the Serial Monitor
32
32
33
33
### Hardware & Software Needed
34
34
@@ -38,33 +38,33 @@ The goals of this project are:
38
38
39
39
## IMU (Inertial Measurement Unit)
40
40
41
-
An IMU is a component that exists of different sensors that records data such as specific force, angular rate, orientation. The Nicla Visions IMU has a **gyroscope** and a **accelerometer.** On the image below you can see exactly where on the board the IMU is located.
41
+
An IMU is a component that consists of different sensors and can record data such as specific force, angular rate, orientation. The Nicla Visions IMU has a **gyroscope** and a **accelerometer.** On the image below you can see exactly where the IMU is located on the board.
42
42
43
43

44
44
45
45
### Accelerometer & Gyroscope
46
46
47
-
An accelerometer is an electromechanical device used to measure acceleration forces. Such forces may be static, like the continuous force of gravity or, as is the case with many mobile devices, dynamic to sense movement or vibrations.
47
+
An accelerometer is an electromechanical device used to measure acceleration forces. Such forces may be static, like the continuous force of gravity, or, as in the case of many mobile devices, dynamic to sense movement or vibrations.
48
48
49
49

50
50
51
-
A gyroscope sensor is a device that can measure and maintain the orientation and angular velocity of an object. Gyroscopes are more advanced than accelerometers, as they can measure the tilt and lateral orientation of an object, whereas an accelerometer can only measure its linear motion. Gyroscope sensors are also called "Angular Rate Sensors" or "Angular Velocity Sensors". Measured in degrees per second, angular velocity is the change in the rotational angle of the object per unit of time.
51
+
A gyroscope sensor is a device that can measure and maintain the orientation and angular velocity of an object. Gyroscopes are more advanced than accelerometers, since they can measure the tilt and lateral orientation of an object, whereas an accelerometer can only measure its linear motion. Gyroscope sensors are also called "Angular Rate Sensors" or "Angular Velocity Sensors". Measured in degrees per second, angular velocity is the change in the rotational angle of the object per unit of time.
52
52
53
53

54
54
55
-
In this tutorial, we will use the gyroscope as an indicator for the direction of the force that is applied to the board. We will also use the accelerometer as a "level" that will provide information about the position of the board. With this application we will be able to read what the relative position of the board is, as well as the degrees by tilting the board up, down, left or right. The results will be visible through the Serial Monitor.
55
+
In this tutorial, you will use the gyroscope as an indicator for the direction of the force that is applied to the board. You will also use the accelerometer as a "level" that will provide information about the position of the board. With this application you will be able to read what the relative position of the board is as well as its orientation, by tilting the board up, down, left or right. The results will be visible through the Serial Monitor.
56
56
57
57
## Instructions
58
58
59
59
### Setting up the Arduino IDE
60
60
61
-
Make sure the latest Nicla Core is installed in the Arduino IDE. **Tools > Board > Board Manager...**. Here we need to look for the **Arduino Mbed OS Nicla Boards** and install it. Now we need to install the library needed for the IMU. Go to **Tools > Manage libraries..**, and search for **Arduino_LSM6DS3** and install it.
61
+
Make sure the latest Nicla Core is installed in the Arduino IDE. **Tools > Board > Board Manager...**. Here you need to look for the **Arduino Mbed OS Nicla Boards** and install it. Now you have to install the library needed for the IMU. Go to **Tools > Manage libraries..**, search for **Arduino_LSM6DS3** and install it.
62
62
63
63
### IMU Sketch
64
64
65
65
The full sketch can be found at the end of the **Instructions** section. Upload the sketch to the board.
66
66
67
-
To use the IMU we first include the library. To make it easier with the values from the IMU, we create a variable for each axis.
67
+
To use the IMU you first need to include the library. To simplify the values coming from the IMU, you can create a variable for each axis.
68
68
69
69
```arduino
70
70
#include <Arduino_LSM6DSOX.h>
@@ -74,7 +74,7 @@ float Gx, Gy, Gz;
74
74
75
75
```
76
76
77
-
To initializes the library we need to call `IMU.begin()`. When the IMU is initialized, we can quickly check the sample rates of the sensors. Calling `IMU.accelerationSampleRate()` and `IMU.gyroscopeSampleRate()` will read the sampling rate of the respective sensor in Hz.
77
+
To initializes the library you need to call `IMU.begin()`. When the IMU is initialized, you can quickly check the sample rates of the sensors. Calling `IMU.accelerationSampleRate()` and `IMU.gyroscopeSampleRate()` will read the sampling rate of the respective sensor in Hz.
78
78
79
79
```arduino
80
80
void setup() {
@@ -100,7 +100,7 @@ void setup() {
100
100
}
101
101
```
102
102
103
-
In the loop of the sketch we can check the sensors to see if there is data available on the IMU sensors, using `IMU.accelerationAvailable()` and `IMU.gyroscopeAvailable()`. Then we can call `IMU.readAcceleration(Ax, Ay, Az)` to read the accelerometer. It will return the value of the **x**, **y** and **z** axis and update the variables `Ax`, `Ay` and `Az`. We do the same for the gyroscope, formatting it in the serial monitor so it will be a bit easier to read the data. The data is being printed with an interval of 500 milliseconds. This can be adjusted by changing the line `delay(500)` at the bottom of the sketch.
103
+
In the loop of the sketch you can check the sensors to see if there is data available on the IMU sensors, using `IMU.accelerationAvailable()` and `IMU.gyroscopeAvailable()`. Then you can call `IMU.readAcceleration(Ax, Ay, Az)` to read the accelerometer. It will return the value of the **x**, **y** and **z** axis and update the variables `Ax`, `Ay` and `Az`. You can do the same for the gyroscope, formatting it in the Serial Monitor so it will be a bit easier to read the data. The data is being printed with an interval of 500 milliseconds. This can be adjusted by changing the line `delay(500)` at the bottom of the sketch.
104
104
105
105
```arduino
106
106
void loop() {
@@ -136,7 +136,7 @@ delay(500);
136
136
137
137
### Testing It Out
138
138
139
-
After successfully uploading the code to the board, we will need to open the Serial Monitor to initialize the program. Once we open it, data will start printing.
139
+
After successfully uploading the code to the board, you will need to open the Serial Monitor to initialize the program. Once you open it, data will start printing.
140
140
141
141
### Complete Sketch
142
142
@@ -201,4 +201,4 @@ delay(500);
201
201
202
202
## Conclusion
203
203
204
-
In this tutorial we have learned how to use the **Arduino_LSM6DSOX** library to access the IMU on the Nicla Vision. With this we learned how to print the gyroscope and accelerometer data in the Arduino IDE serial monitor.
204
+
In this tutorial you have learned how to use the **Arduino_LSM6DSOX** library to access the IMU on the Nicla Vision. With this you learned how to print the gyroscope and accelerometer data in the Arduino IDE Serial Monitor.
0 commit comments