The above is the code i am using.
My error is
Traceback (most recent call last):
File "<stdin>", line 29, in <module>
ValueError: GP10 in use
I am not able to add any attachment.I am not sure why.
The camera i am using is https://www.robotshop.com/uk/ov2640-camera-board.html?gclid=Cj0KCQjw9ZGYBhCEARIsAEUXITVoIsq87Ol3shMcmhhp3bgYjo3AgtSdrHoNA4uRH7UJ65aMXgrmDIwaApj5EALw_wcB
The MicroSD card with pins - CS,SCK,MOSI,MISO,VCC,GND
The connection I used is as follows
Pico - Camera
3V3 - 3V3 | GP9 - SIOC | GP7 - VSYNC | GP11 - PCLK | GP19 - D9 | GP17 - D7 | GP15 - D5 |
GP13 - D3 | GP10 - RESET | GND - GND | GP8 - SIOD | GP21 - HREF | GP20 - XCLK | GP18 - D8 |
GP16 - D6 | GP14 - D4 | GP12 -D2
Pico - SD card
CS - GP13 | SCK - GP10 | MOSI - GP11 | MISO - GP12 | VCC - VBUS | GND - GND
@zander The SD card is working fine and camera is working fine.I am getting error while connecting the both.Any tips?I have given everything in detail above 😐 😐
@jasline123 I am confused, first you say it is working, then you say it is not. Pick one.
Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting
My aim is to connect the camera, capture image and save to an SD card which is not working and throwing the error
import os import board import busio as io import digitalio import storage import adafruit_sdcard import sdcardio import adafruit_ov2640 import microcontroller from time import sleep import time from displayio import ( Bitmap, Group, TileGrid, FourWire, release_displays, ColorConverter, Colorspace, ) SD_CS = board.GP13 spi = io.SPI(board.GP10, board.GP11, board.GP12) cs = digitalio.DigitalInOut(SD_CS) sdcard = adafruit_sdcard.SDCard(spi, cs) vfs = storage.VfsFat(sdcard) storage.mount(vfs, "/sd") with digitalio.DigitalInOut(board.GP10) as reset: reset.switch_to_output(False) time.sleep(0.001) bus = busio.I2C(board.GP9, board.GP8) cam = adafruit_ov2640.OV2640( bus, data_pins=[ board.GP12, board.GP13, board.GP14, board.GP15, board.GP16, board.GP17, board.GP18, board.GP19, ], clock=board.GP11, vsync=board.GP7, href=board.GP21, mclk=board.GP20, shutdown=None, reset=board.GP10, ) cam.colorspace = adafruit_ov2640.OV2640_COLOR_JPEG cam.size = adafruit_ov2640.OV2640_SIZE_QQVGA buf = bytearray(cam.capture_buffer_size) jpeg = cam.capture(buf) print(f"Captured {len(jpeg)} bytes of jpeg data") try: with open("/sd/jpeg.jpg", "wb") as f: f.write(jpeg) except OSError as e: print(e) print( "A 'read-only filesystem' error occurs if you did not correctly install" "\nov2640_jpeg_kaluga1_3_boot.py as CIRCUITPY/boot.py and reset the board" ) print("Wrote to CIRCUITPY/jpeg.jpg")
@jasline123 WOW, what the heck are all those wires. I can't help, I don't have a camera like that.
Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting
@jasline123 First time I saw this sketch. I have no experience with that hardware so I will have to bow out. I do see GP10 mentioned in your code, so the first thing I would do is use another GPIO pin. Good luck.
Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting
@jasline123 Is that an ARDUCAM camera? If so ask over at their site especially if it's one of their sketch's.
Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting
This is slightly different from Arducam actually. Anyways il try that as well. Thanks a lot for the help.
Certainly a mess of wires making it easy to make a mistake. I would check to see if there is any ribbon connection available? I agree the error seems to involve a GPIO conflict perhaps with the SD module? The old RPi I use you can just plug a camera into it.
I don't use this equipment nor do I use Python, but I notice that you ARE trying to use GP10 twice in the same sketch ...
Camera: GP10 - RESET
SD card: SCK - GP10
That may have something to do with your problem.
I had a psychic girlfriend but she left me before we met.