|
21 | 21 |
|
22 | 22 | from machine import I2C |
23 | 23 |
|
| 24 | +# Add driver paths when running via mpremote mount lib/ |
| 25 | +for p in ("daplink_flash", "steami_config", "lis2mdl", "ssd1327"): |
| 26 | + path = "/remote/" + p |
| 27 | + if path not in sys.path: |
| 28 | + sys.path.insert(0, path) |
| 29 | + |
24 | 30 |
|
25 | 31 | def show_screen(i2c, lines): |
26 | 32 | """Display text lines on the OLED screen, then free the driver.""" |
@@ -133,13 +139,13 @@ def show_screen(i2c, lines): |
133 | 139 | print("Verification (5 heading readings after reload):") |
134 | 140 | lines = ["=== COMPAS ===", "", "Verification:"] |
135 | 141 | for i in range(5): |
136 | | - heading = mag2.heading() |
| 142 | + heading = mag2.heading_flat_only() |
137 | 143 | norm = mag2.calibrated_field() |
138 | 144 | line = " {}: cap={:.0f} deg".format(i + 1, heading) |
139 | 145 | print(" Reading {}: heading={:.1f} deg norm=({:.3f}, {:.3f}, {:.3f})".format( |
140 | 146 | i + 1, heading, norm[0], norm[1], norm[2])) |
141 | 147 | lines.append(line) |
142 | 148 | sleep_ms(500) |
143 | 149 |
|
144 | | -show_screen(i2c, [*lines, "", "Termine !"]) |
| 150 | +show_screen(i2c, lines + ["", "Termine !"]) # noqa: RUF005 |
145 | 151 | print("\nDone! Calibration is stored and will be restored at next boot.") |
0 commit comments