القطع

مقياس التسارع LSM6DSOX والجيروسكوب

يقرأ ST LSM6DSOX، وهو وحدة قياس حركة سداسية المحاور، التسارع ومعدل الدوران، لكل منهما ستة عشر بتًا، عبر I2C على العنوان 0x6A، من 12.5 Hz إلى 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.

أسماء أخرى: LSM6DS، LSM6DS33، LSM6DSO، Adafruit LSM6DSOX، وحدة قياس حركة سداسية المحاور. إنه حساس الحركة في لوحات Adafruit وArduino الأحدث: ضوضاء أقل من MPU6050 ونواة تعلّم آلي خاصة به، يستبعدها النموذج.

Pins

Pin ماذا تفعل
VIN، GND التغذية، من 3 إلى 5 فولت على اللوحة.
SCL، SDA I2C. تحمل اللوحة مقاومات الرفع.
INT1، INT2 المقاطعات، يتركها النموذج بحالة عالية المقاومة.

الخصائص

address هو 0x6A أو 0x6B. القيم pitch وroll وheading هي وضعية اللوحة؛ والمنزلقات الثلاثة تميلها وتدوّرها، ويقرأ الجيروسكوب المعدل أثناء تحرك منزلق.

قراءته على Arduino

بمكتبة Adafruit، التي يوفرها Mokxi باسم 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);
}

كيف يتحدث

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.

ما لا يحاكيه

الـFIFO، والوظائف المدمجة (عدّاد الخطى، النقر، الإمالة، نواة تعلّم الآلة)، وأطراف المقاطعات، والمرشّحات، والضوضاء والإزاحات.

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.