Created
March 10, 2014 06:59
-
-
Save lis186/9460594 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| var RaspiCam = require("raspicam"); | |
| var moment = require('moment'); | |
| var timestring = moment().format('YYYY-MM-DD HH.MM.SS'); | |
| var camera = new RaspiCam({ | |
| mode: 'photo', | |
| output: timestring+'.jpg' | |
| }); | |
| //to take a snapshot, start a timelapse or video recording | |
| camera.start( ); | |
| camera.on("started", function(){ | |
| console.log('started'); | |
| }); | |
| //listen for the "read" event triggered when each new photo/video is saved | |
| camera.on("read", function(err, filename){ | |
| console.log('err:' + err); | |
| console.log('filename:' + filename); | |
| }); | |
| //listen for the process to exit when the timeout has been reached | |
| camera.on("exited", function(){ | |
| console.log('exited'); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment