Skip to content

Commit d41cf56

Browse files
committed
change from pin to digitalio
1 parent 5079b56 commit d41cf56

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

adafruit_ov5640.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
from typing import Optional, Sequence, List, Union
3838
from busio import I2C
3939
from microcontroller import Pin
40+
from digitalio import DigitalInOut
4041
except ImportError:
4142
pass
4243

@@ -822,8 +823,8 @@ def __init__(
822823
clock: Pin,
823824
vsync: Pin,
824825
href: Pin,
825-
shutdown: Optional[Pin] = None,
826-
reset: Optional[Pin] = None,
826+
shutdown: Optional[DigitalInOut] = None,
827+
reset: Optional[DigitalInOut] = None,
827828
mclk: Optional[Pin] = None,
828829
mclk_frequency: int = 20_000_000,
829830
i2c_address: int = 0x3C,
@@ -837,9 +838,9 @@ def __init__(
837838
vsync (microcontroller.Pin): The vsync signal from the OV5640.
838839
href (microcontroller.Pin): The href signal from the OV5640, \
839840
sometimes inaccurately called hsync.
840-
shutdown (Optional[microcontroller.Pin]): If not None, the shutdown
841+
shutdown (Optional[digitalio.DigitalInOut]): If not None, the shutdown
841842
signal to the camera, also called the powerdown or enable pin.
842-
reset (Optional[microcontroller.Pin]): If not None, the reset signal
843+
reset (Optional[digitalio.DigitalInOut]): If not None, the reset signal
843844
to the camera.
844845
mclk (Optional[microcontroller.Pin]): The pin on which to create a
845846
master clock signal, or None if the master clock signal is
@@ -862,7 +863,7 @@ def __init__(
862863
self._mclk_pwm = None
863864

864865
if shutdown:
865-
self._shutdown = digitalio.DigitalInOut(shutdown)
866+
self._shutdown = shutdown
866867
self._shutdown.switch_to_output(True)
867868
time.sleep(0.1)
868869
self._shutdown.switch_to_output(False)
@@ -871,7 +872,7 @@ def __init__(
871872
self._shutdown = None
872873

873874
if reset:
874-
self._reset = digitalio.DigitalInOut(reset)
875+
self._reset = reset
875876
self._reset.switch_to_output(False)
876877
time.sleep(0.1)
877878
self._reset.switch_to_output(True)

0 commit comments

Comments
 (0)