Skip to content

Commit 6835ba8

Browse files
Update code.py
1 parent 4a37117 commit 6835ba8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

PyGamer_Thermal_Camera/code.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# 2020-01-29 v3.2
33
# (c) 2020 Jan Goolsbey for Adafruit Industries
44

5+
from thermal_cam_converters import celsius_to_fahrenheit, fahrenheit_to_celsius
56
import time
67
import board
78
import displayio
@@ -11,7 +12,6 @@
1112
from adafruit_display_shapes.rect import Rect
1213
import adafruit_amg88xx
1314
from adafruit_pybadger import PyBadger
14-
from thermal_cam_converters import celsius_to_fahrenheit, fahrenheit_to_celsius
1515

1616
# Establish panel instance and check for joystick
1717
panel = PyBadger(pixels_brightness=0.1) # Set NeoPixel brightness
@@ -382,16 +382,16 @@ def move_buttons(joystick=False): # Read position buttons and joystick
382382
panel.play_tone(698, 0.030) # F5
383383
if display_focus:
384384
display_focus = False # restore previous (original) range values
385-
MIN_RANGE_F = temp_min_range_f
386-
MAX_RANGE_F = temp_max_range_f
385+
MIN_RANGE_F = orig_min_range_f
386+
MAX_RANGE_F = orig_max_range_f
387387
# update range min and max values in Celsius
388388
MIN_RANGE_C = fahrenheit_to_celsius(MIN_RANGE_F)
389389
MAX_RANGE_C = fahrenheit_to_celsius(MAX_RANGE_F)
390390
flash_status("ORIG", 0.2)
391391
else:
392392
display_focus = True # set range values to image min/max
393-
temp_min_range_f = MIN_RANGE_F
394-
temp_max_range_f = MAX_RANGE_F
393+
orig_min_range_f = MIN_RANGE_F
394+
orig_max_range_f = MAX_RANGE_F
395395
MIN_RANGE_F = celsius_to_fahrenheit(v_min)
396396
MAX_RANGE_F = celsius_to_fahrenheit(v_max)
397397
MIN_RANGE_C = v_min # update range temp in Celsius

0 commit comments

Comments
 (0)