Linh kiện

Gia tốc kế LSM6DSOX và con quay hồi chuyển

IMU sáu trục ST LSM6DSOX đọc gia tốc và tốc độ quay, mỗi loại mười sáu bit, qua I2C tại 0x6A, từ 12.5 Hz đến 6.66 kHz.

This part has a page of its own, with a note on using it and a circuit to try: the part page.

Tên gọi khác: LSM6DS, LSM6DS33, LSM6DSO, Adafruit LSM6DSOX, IMU sáu trục. Đây là cảm biến chuyển động trên các bo Adafruit và Arduino mới hơn: nhiễu thấp hơn MPU6050 và có riêng một lõi học máy, phần mà mô hình không mô phỏng.

Pins

Pin Công dụng
VIN, GND Nguồn cấp, 3 đến 5 V trên bo mạch.
SCL, SDA I2C. Bo mạch có sẵn điện trở kéo lên.
INT1, INT2 Các ngắt, mô hình để ở trạng thái high-Z.

Thuộc tính

address là 0x6A hoặc 0x6B. pitch, roll và heading là tư thế của bo mạch; ba thanh trượt nghiêng và xoay bo, và con quay hồi chuyển đo tốc độ góc khi thanh trượt di chuyển.

Đọc nó trên Arduino

Với thư viện của Adafruit, Mokxi kèm sẵn dưới tên 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);
}

Cách nó giao tiếp

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.

Những gì nó không mô phỏng

FIFO, các chức năng nhúng (bộ đếm bước, gõ, nghiêng, lõi học máy), các chân ngắt, bộ lọc, nhiễu và độ lệch.

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.