Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame
- import pygame.camera
- import sys
- pygame.camera.init()
- if len(pygame.camera.list_cameras()) > 0:
- cam = pygame.camera.Camera(pygame.camera.list_cameras()[-1],(640,480))
- cam.start()
- def getSnapshot():
- if cam is not None:
- img = cam.get_image()
- pygame.image.save(img,"filename.jpg")
- import serial
- ser= serial.Serial('/dev/ttyUSB0')
- ser= serial.Serial('/dev/bus/usb/002/003')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement