Skip to content

Commit f32c65d

Browse files
committed
fix imports
1 parent 069a57e commit f32c65d

File tree

1 file changed

+3
-4
lines changed
  • QT_Py/QT_Py_ESP32_S2_RoundDisplay_Compass

1 file changed

+3
-4
lines changed

QT_Py/QT_Py_ESP32_S2_RoundDisplay_Compass/code.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import math
21
# SPDX-FileCopyrightText: 2025 Tim Cocks for Adafruit Industries
32
# SPDX-License-Identifier: MIT
43
#
54
# Adapted from QualiaS3 Compass Learn Guide by Liz Clark (Adafruit Industries)
65
# https://learn.adafruit.com/qualia-s3-compass/
76

87
import time
9-
from math import atan2, degrees
8+
from math import atan2, degrees, radians
109
import adafruit_lis3mdl
1110
import board
1211
from adafruit_lsm6ds.lsm6dsox import LSM6DSOX
@@ -155,13 +154,13 @@ def map_range(x, in_min, in_max, out_min, out_max):
155154
bitmaptools.rotozoom(rotated_pointer, pointer_eraser,
156155
ox=120, oy=120,
157156
px=pointer.width // 2, py=pointer.height,
158-
angle=math.radians(last_heading + offset_angle))
157+
angle=radians(last_heading + offset_angle))
159158

160159
# draw the new pointer needle
161160
bitmaptools.rotozoom(rotated_pointer, pointer,
162161
ox=120, oy=120,
163162
px=pointer.width // 2, py=pointer.height,
164-
angle=math.radians(heading + offset_angle))
163+
angle=radians(heading + offset_angle))
165164

166165
# set the previous heading to compare next iteration
167166
last_heading = heading

0 commit comments

Comments
 (0)