Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Capture laser using Pi camera module
import RPi.GPIO as GPIO
from picamera import PiCamera
GPIO.setmode(GPIO.BCM)
laser_pin = 22
GPIO.setup(laser_pin, GPIO.OUT)
print(GPIO.VERSION)
print(GPIO.RPI_INFO)
camera = PiCamera()
camera.resolution = (1024, 768)
time.sleep(2) # Camera warm-up time
GPIO.output(laser_pin, GPIO.HIGH)
camera.capture("dot.jpg")
GPIO.output(laser_pin, GPIO.LOW)
GPIO.cleanup()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment