This part has a page of its own, with a note on using it and a circuit to try: the part page.
Alias: LSM6DS, LSM6DS33, LSM6DSO, Adafruit LSM6DSOX, IMU enam sumbu. Ini sensor gerak di board Adafruit dan Arduino yang lebih baru: noise lebih rendah daripada MPU6050 dan punya machine learning core sendiri, yang tidak dimodelkan.
Pins
| Pin | Fungsinya |
|---|---|
VIN, GND |
Catu daya, 3 sampai 5 V pada board. |
SCL, SDA |
I2C. Board membawa pull-up-nya. |
INT1, INT2 |
Interrupt, dibiarkan high-Z oleh model. |
Properti
address adalah 0x6A atau 0x6B. pitch, roll dan heading menunjukkan posisi board; tiga slider memiringkan dan memutarnya, dan giroskop membaca lajunya saat slider digerakkan.
Membacanya di Arduino
Dengan library Adafruit, yang Mokxi sediakan sebagai Adafruit_LSM6DSOX.h:
#include <Adafruit_LSM6DSOX.h>
Adafruit_LSM6DSOX sox;
void setup() {
Serial.begin(9600);
sox.begin_I2C();
}
void loop() {
sensors_event_t accel, gyro, temp;
sox.getEvent(&accel, &gyro, &temp);
Serial.println(accel.acceleration.z); // 9.81 flat on the bench
delay(200);
}
Cara komunikasinya
WHO_AM_I (0x0F) reads 0x6C. CTRL1_XL (0x10) and CTRL2_G (0x11) set each
sensor's data rate (zero is off, the reset) and range; CTRL3_C (0x12) has the reset
bits and IF_INC, which steps the address. At each sample STATUS_REG (0x1E) flags
new data, and the outputs follow: the temperature at 0x20, the gyroscope at 0x22
and the accelerometer at 0x28, low byte first. For 10 ms after power-on it boots and
does not answer.
Apa yang tidak dimodelkannya
FIFO, fungsi bawaan (pedometer, tap, tilt, machine learning core), pin interrupt, filter, noise dan offset.
Common mistakes
Reading zeros: both sensors power up off until a data rate is written. Reading a gyroscope that never moves: it reads a rate, so it is zero whenever the board is still.