95
95
96
96
class VC0706 :
97
97
"""Driver for VC0706 serial TTL camera module.
98
- :param ~busio.UART uart: uart serial or compatible interface
99
- :param int buffer_size: Receive buffer size
98
+ :param ~busio.UART uart: uart serial or compatible interface
99
+ :param int buffer_size: Receive buffer size
100
100
"""
101
101
102
102
def __init__ (self , uart , * , buffer_size = 100 ):
@@ -148,7 +148,7 @@ def baudrate(self, baud):
148
148
@property
149
149
def image_size (self ):
150
150
"""Get the current image size, will return a value of IMAGE_SIZE_640x480,
151
- IMAGE_SIZE_320x240, or IMAGE_SIZE_160x120.
151
+ IMAGE_SIZE_320x240, or IMAGE_SIZE_160x120.
152
152
"""
153
153
if not self ._run_command (_READ_DATA , b"\0 x04\x04 \x01 \x00 \x19 " , 6 ):
154
154
raise RuntimeError ("Failed to read image size!" )
@@ -157,7 +157,7 @@ def image_size(self):
157
157
@image_size .setter
158
158
def image_size (self , size ):
159
159
"""Set the image size to a value of IMAGE_SIZE_640x480, IMAGE_SIZE_320x240, or
160
- IMAGE_SIZE_160x120.
160
+ IMAGE_SIZE_160x120.
161
161
"""
162
162
if size not in (IMAGE_SIZE_640x480 , IMAGE_SIZE_320x240 , IMAGE_SIZE_160x120 ):
163
163
raise ValueError (
@@ -170,8 +170,7 @@ def image_size(self, size):
170
170
171
171
@property
172
172
def frame_length (self ):
173
- """Return the length in bytes of the currently capture frame/picture.
174
- """
173
+ """Return the length in bytes of the currently capture frame/picture."""
175
174
if not self ._run_command (_GET_FBUF_LEN , b"\x01 \x00 " , 9 ):
176
175
return 0
177
176
frame_length = self ._buffer [5 ]
@@ -184,11 +183,16 @@ def frame_length(self):
184
183
return frame_length
185
184
186
185
def take_picture (self ):
187
- """Tell the camera to take a picture. Returns True if successful.
188
- """
186
+ """Tell the camera to take a picture. Returns True if successful."""
189
187
self ._frame_ptr = 0
190
188
return self ._run_command (_FBUF_CTRL , bytes ([0x1 , _STOPCURRENTFRAME ]), 5 )
191
189
190
+ def resume_video (self ):
191
+ """Tell the camera to resume being a camera after the video has stopped
192
+ (Such as what happens when a picture is taken).
193
+ """
194
+ return self ._run_command (_FBUF_CTRL , bytes ([0x1 , _RESUMEFRAME ]), 5 )
195
+
192
196
def read_picture_into (self , buf ):
193
197
"""Read the next bytes of frame/picture data into the provided buffer.
194
198
Returns the number of bytes written to the buffer (might be less than
0 commit comments