Created
November 27, 2018 02:06
-
-
Save kevinlebrun/7559cacea1c9ae95e72510b888d4b294 to your computer and use it in GitHub Desktop.
Capture laser using Pi camera module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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