{
  "id": "howmanyoliversarethere/micropython-lsm6dsl",
  "name": "micropython-lsm6dsl",
  "prettyName": "micropython-lsm6dsl",
  "description": "MicroPython driver for the ST LSM6DSL accelerometer and gyroscope",
  "version": "",
  "author": "howmanyoliversarethere",
  "license": "MIT",
  "tags": [],
  "status": "VALID",
  "official": false,
  "source": "https://github.com/howmanyoliversarethere/micropython-lsm6dsl",
  "updatedAt": "2026-10-28T08:36:36.216Z",
  "page": "https://checkmim.com/packages/howmanyoliversarethere+micropython-lsm6dsl",
  "createdAt": "2026-10-28T08:36:34.668Z",
  "submittedBy": "oliverr",
  "install": {
    "mpremote": "mpremote mip install github:howmanyoliversarethere/micropython-lsm6dsl",
    "mip": "import mip; mip.install(\"github:howmanyoliversarethere/micropython-lsm6dsl\")"
  },
  "readme": "# LSM6DSL accelerometer and gyroscope\n\nA MicroPython driver for the STMicroelectronics **LSM6DSL** 6-axis IMU\nover I2C: acceleration, angular rate and die temperature, configurable\ndata rates and full scales, low-power modes, and the wake-up (motion)\ninterrupt.\n\nCopy `lsm6dsl.py` onto your board, or install it with `mip`:\n\n```python\nimport mip\nmip.install(\"github:HowManyOliversAreThere/micropython-lsm6dsl\")\n```\n\n## Usage\n\n```python\nfrom machine import I2C, Pin\nimport lsm6dsl\n\ni2c = I2C(0, sda=Pin(19), scl=Pin(20), freq=400_000)\nimu = lsm6dsl.LSM6DSL(i2c, accel_scale=2, gyro_scale=250)\nprint(imu.acceleration())   # (x, y, z) in g\nprint(imu.gyro())           # (x, y, z) in °/s\nprint(imu.temperature())    # °C\n\n# Motion detection at low power: accelerometer only, interrupt on INT1.\nimu.gyro_odr(lsm6dsl.ODR_OFF)\nimu.accel_odr(lsm6dsl.ODR_26HZ, low_power=True)\nimu.wake_up_interrupt(threshold_g=0.08)\nif imu.wake_up_source() & lsm6dsl.WU_IA:   # reading clears the latched INT\n    print(\"moved\")\n\nimu.power_down()\n```\n\n## Notes\n\n- The address is 0x6A with SDO/SA0 low and 0x6B with it high. Tie CS\n  high to select I2C.\n- The constructor checks WHO_AM_I (0x6A) and raises `OSError` if it\n  doesn't match, then does a software reset unless `reset=False`.\n- The wake-up threshold goes in steps of full scale / 64 (31 mg at ±2 g).\n- Block data update is enabled, so the bytes of one sample are never\n  mixed with the next.\n\n## License\n\nMIT - see [LICENSE](LICENSE).\n"
}