Please tell me - what am I doing wrong?
I am using the camera connection library
https://github.com/adafruit/Adafruit_Ci ... hon_OV7670
Code: Select all
import board
from adafruit_ov7670 import OV7670
import time
import digitalio
cam = OV7670(
bus,
data_pins=[board.PCC_D0, board.PCC_D1, board.PCC_D2, board.PCC_D3, board.PCC_D4, board.PCC_D5, board.PCC_D6, board.PCC_D7],
clock=board.PCC_CLK,
vsync=board.PCC_DEN1,
href=board.PCC_DEN2,
mclk=board.D29,
shutdown=board.D39,
reset=board.D38,
)
cam.size = OV7670_SIZE_DIV16
buf = bytearray(2 * cam.width * cam.height)
try:
with open("photobin.txt", "wb") as photo:
while True:
temp = cam.capture(buf)
photo.write(temp)
photo.flush()
time.sleep(1)
except OSError as e:
print("error")