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 4
4
import struct
5
5
import board
6
6
from digitalio import DigitalInOut , Direction , Pull
7
- from adafruit_debouncer import Debouncer
7
+ from adafruit_debouncer import Debouncer , Button
8
8
import bitmaptools
9
9
import busio
10
10
import adafruit_lis3dh
@@ -177,7 +177,7 @@ def __init__(self) -> None:
177
177
178
178
self .shutter_button = DigitalInOut (board .BUTTON )
179
179
self .shutter_button .switch_to_input (Pull .UP )
180
- self .shutter = Debouncer (self .shutter_button )
180
+ self .shutter = Button (self .shutter_button )
181
181
182
182
print ("reset camera" )
183
183
self ._cam_reset = DigitalInOut (board .CAMERA_RESET )
Original file line number Diff line number Diff line change 1
-
2
-
3
-
4
-
5
1
import os
6
2
import sys
7
3
import time
37
33
38
34
pycam .keys_debounce ()
39
35
# 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" )
43
43
if pycam .mode_text == "STOP" :
44
44
pycam .capture_into_bitmap (last_frame )
45
45
pycam .stop_motion_frame += 1
98
98
except RuntimeError as e :
99
99
pycam .display_message ("Error\n No SD Card" , color = 0xFF0000 )
100
100
time .sleep (0.5 )
101
- if pycam .shutter .rose :
102
- print ("Shutter released" )
103
-
104
101
if pycam .card_detect .fell :
105
102
print ("SD card removed" )
106
103
pycam .unmount_sd_card ()
148
145
#pycam.set_resolution(pycam.resolutions[new_res])
149
146
if pycam .select .fell :
150
147
print ("SEL" )
151
- print (pycam .autofocus_status )
152
- pycam .autofocus ()
153
- print (pycam .autofocus_status )
154
148
if pycam .ok .fell :
155
149
print ("OK" )
You can’t perform that action at this time.
0 commit comments