'''
example name：Camera
version：v1.0
date：2020.3
Author：01Studio
Description: Use the camera module to take pictures and save
Forum: forum.01studio.org
'''

#import related modules
from picamera import PiCamera
from time import sleep

#creat camera object
camera = PiCamera()

#active cmaera
camera.start_preview()

sleep(3) #Wait for the camera to stabilize

#Take 5 photos and save them to the desktop
for i in range(5):
    camera.capture('/home/pi/Desktop/'+str(i)+'.jpg')

#Turn off the camera
camera.stop_preview()
