Tuesday, December 23, 2014

Camera for the Weather Balloon

I got the camera on my Raspberry Pi working.  It was rather simple. Using Raspbian, I just had to enable the camera (run sudo raspi-config), then figure out the code.  Here is a simple program I wrote, just to record the commands for the camera:

*******************

import time
import picamera

camera = picamera.PiCamera()

# Use to view current picture from camera on screen connected to
# the Raspberry Pi. Not for use with ssh.
#camera.start_preview() 

# Use when ribbon of camera is on the top of the camera. Make 'False'
# if the ribbon is on the bottom of the camera.
camera.vflip = True
camera.hflip = True

camera.brightness = 60

# Capture a single image
camera.capture('image.jpg')

# Capture a video
camera.start_recording('video3.h264')
time.sleep(5)                # Length of video
camera.stop_recording()


*******************

No comments:

Post a Comment