File tree Expand file tree Collapse file tree 2 files changed +9
-15
lines changed Expand file tree Collapse file tree 2 files changed +9
-15
lines changed Original file line number Diff line number Diff line change 44import struct
55import board
66from digitalio import DigitalInOut , Direction , Pull
7- from adafruit_debouncer import Debouncer
7+ from adafruit_debouncer import Debouncer , Button
88import bitmaptools
99import busio
1010import adafruit_lis3dh
@@ -177,7 +177,7 @@ def __init__(self) -> None:
177177
178178 self .shutter_button = DigitalInOut (board .BUTTON )
179179 self .shutter_button .switch_to_input (Pull .UP )
180- self .shutter = Debouncer (self .shutter_button )
180+ self .shutter = Button (self .shutter_button )
181181
182182 print ("reset camera" )
183183 self ._cam_reset = DigitalInOut (board .CAMERA_RESET )
Original file line number Diff line number Diff line change 1-
2-
3-
4-
51import os
62import sys
73import time
3733
3834 pycam .keys_debounce ()
3935 # test shutter button
40- if pycam .shutter .fell :
41- print ("Shutter pressed" )
42-
36+ if pycam .shutter .long_press :
37+ print ("FOCUS" )
38+ print (pycam .autofocus_status )
39+ pycam .autofocus ()
40+ print (pycam .autofocus_status )
41+ if pycam .shutter .short_count :
42+ print ("Shutter released" )
4343 if pycam .mode_text == "STOP" :
4444 pycam .capture_into_bitmap (last_frame )
4545 pycam .stop_motion_frame += 1
9898 except RuntimeError as e :
9999 pycam .display_message ("Error\n No SD Card" , color = 0xFF0000 )
100100 time .sleep (0.5 )
101- if pycam .shutter .rose :
102- print ("Shutter released" )
103-
104101 if pycam .card_detect .fell :
105102 print ("SD card removed" )
106103 pycam .unmount_sd_card ()
148145 #pycam.set_resolution(pycam.resolutions[new_res])
149146 if pycam .select .fell :
150147 print ("SEL" )
151- print (pycam .autofocus_status )
152- pycam .autofocus ()
153- print (pycam .autofocus_status )
154148 if pycam .ok .fell :
155149 print ("OK" )
You can’t perform that action at this time.
0 commit comments