0

I want to light up the picamera LED using python for a few seconds as a test to see if it works, without actually taking a photo. And yes I know I can test that by just taking a photo and watching it light up

I've read through the picamera documentation and can't seem to find a command to do it, any help would be much appreciated.

1

You can turn on the camera led through the pi’s GPIO using the python code below:

 #!/usr/bin/env python
 import time
 import RPi.GPIO as GPIO

 # Use GPIO numbering
 GPIO.setmode(GPIO.BCM)
    
 # Set GPIO for camera LED
 # Use 5 for Model A/B and 32 for Model B+
 CAMLED = 5 
 
 # Set GPIO to output
 GPIO.setup(CAMLED, GPIO.OUT, initial=False)

 GPIO.output(CAMLED,True) # On
 time.sleep(1)
 GPIO.output(CAMLED,False) # Off

 But I believe that this may require you to first disable the red led by adding the following line:

disable_camera_led=1

To your config file which can be opened with the following command:

sudo nano /boot/config.txt
  • Of course this will only work with Picamera V1. Picamera V2 does not have a LED. – Dirk Sep 26 '18 at 17:34

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.