Code and images for using PiCam and Python to snap pictures after adjusting the brightness ↓
from picamera import PiCamera
import time
camera = PiCamera()
#rotate camera to the correct orientation
camera.rotation = 180
#taking 3 pics using for loop
#each pic have difference brightness
for i in range (3):
camera.brightness = (i+1)*30
camera.capture('/home/pi/Desktop/image%s.jpg' %(i+1))
time.sleep(1)
#set back camera to original brightness
camera.brightness = 50
camera.capture('/home/pi/Desktop/imageNormalBrightness.jpg' )
brightness = 30 brightness = 60 brightness = 90 brightness = 50 (default brightness)
To record 30s video and save to desktop using date and time as filename ↓
from picamera import PiCamera
from time import sleep
import datetime
date = datetime.datetime.now().strftime("%d-%m-%Y_%H:%M:%S")
camera = PiCamera()
#camera.start_preview()
#sleep(5)
#camera.stop_preview()
camera.rotation = 180
camera.start_preview()
camera.start_recording('/home/pi/Desktop/'+date+'.h264')
sleep(30)
camera.stop_recording()
camera.stop_preview()