@@ -50,32 +50,9 @@ Example setup:
5050
5151``` python
5252from machine import I2C , Pin
53- from device import LIS2MDL
53+ from lis2mdl import LIS2MDL
5454
55- i2c = I2C(1 , scl = Pin(22 ), sda = Pin(21 ))
56- mag = LIS2MDL(i2c)
57- ```
58-
59- ---
60-
61- ## 🧩 Installation
62-
63- ### 1. Copy files to your board
64-
65- Upload both files using Thonny, mpremote, or ampy:
66-
67- ```
68- device.py
69- lis2mdl/const.py
70- ```
71-
72- ### 2. Import and initialize
73-
74- ``` python
75- from machine import I2C , Pin
76- from device import LIS2MDL
77-
78- i2c = I2C(1 , scl = Pin(22 ), sda = Pin(21 ))
55+ i2c = I2C(1 )
7956mag = LIS2MDL(i2c)
8057```
8158
@@ -242,7 +219,7 @@ print("Register dump:", regs)
242219
243220``` python
244221from machine import I2C , Pin
245- from device import LIS2MDL
222+ from lis2mdl import LIS2MDL
246223import time
247224
248225i2c = I2C(1 , scl = Pin(22 ), sda = Pin(21 ))
@@ -257,15 +234,6 @@ while True:
257234
258235---
259236
260- ## 🧾 Notes
261-
262- * The LIS2MDL outputs magnetic data in ** LSB** , with a conversion factor of ** 0.15 µT/LSB** .
263- * Temperature readings are ** relative only** (not absolute).
264- * Calibration should be repeated if the sensor environment changes (metal nearby, relocation, etc.).
265- * Tilt compensation requires an external ** accelerometer** or IMU (e.g., LIS3DH, MPU6050, BNO055).
266-
267- ---
268-
269237## 📚 References
270238
271239* [ STMicroelectronics LIS2MDL Datasheet] ( https://www.st.com/resource/en/datasheet/lis2mdl.pdf )
0 commit comments