Reputation: 1
I have a Raspberry Pi 4 which I have connected to an Arducam 64MP OwlSight Auto-Focus camera (ov64a40) and 2 neopixel jewel LEDs (7 x 5050 RGBW). I need to be able to take a photo every 30 seconds over 9 hours in sync with the LEDs flashing. Ideally I would be able to save a readme doc to the SD card that I could just open and run every time and use the same application (for camera I'm using the Pi terminal and for the LEDs I'm using Python). Does anyone know how I could get them operating from the same application and synced?
For timed camera photos every 30 seconds over 9 hours saved with the timestamp the below code works:
libcamera-still -t 32400000 --timelapse 300000 --datetime --width 1920 --height 1080 --shutter 5000
In another terminal, I then enter a virtual environment using python to flash the LEDs every 30 seconds:
source .venv/bin/activate #Entering virtual environment
ptpython #Entering python space
import time
import board
import neopixel
pixels1 = neopixel.NeoPixel(board.D18, 7, bpp=4)
pixels2 = neopixel.NeoPixel(board.D21, 7, bpp=4)
while True:
#Turn both neopixels red
pixels1.fill((255, 0, 0))
pixels2.fill((255, 0, 0))
pixels1.show()
pixels2.show()
#Time on (seconds)
time.sleep(30)
#Turn both neopixels off
pixels1.fill((0, 0, 0))
pixels2.fill((0, 0, 0))
pixels1.show()
pixels2.show()
#Time off (seconds)
time.sleep(30)
Both codes work fine but don't automatically sync together and I have to re-type it in after I open the system. Does anyone know how I could get them synced and more user friendly for others to open the system and run?
Upvotes: 0
Views: 43