Skip to content

Commit 8526c35

Browse files
authored
Add files via upload
1 parent 24b68c1 commit 8526c35

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Air Visual API/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def map_value(v, x_min, x_max, y_min, y_max):
6565
return (y_min + (((y_max - y_min)/(x_max - x_min)) * (v - x_min)))
6666

6767

68-
def contrain(value, min_value, max_value):
68+
def constrain(value, min_value, max_value):
6969
if(value > max_value):
7070
return max_value
7171

@@ -179,7 +179,7 @@ def aqi_graphics(value):
179179
tft.text(str(value_l[j]), (i - 2), 94, tft.BLACK)
180180
tft.text(str(value_h[j]), (i - 2), 108, tft.BLACK)
181181

182-
temp = contrain(value, 0, 500)
182+
temp = constrain(value, 0, 500)
183183
temp = int(map_value(temp, 0, 500, 12, 148))
184184
tft.line(temp, 85, (temp - 4), 81, tft.WHITE)
185185
tft.line(temp, 85, (temp + 4), 81, tft.WHITE)

0 commit comments

Comments
 (0)