Skip to content

Instantly share code, notes, and snippets.

@lis186
Created March 10, 2014 06:59
Show Gist options
  • Select an option

  • Save lis186/9460594 to your computer and use it in GitHub Desktop.

Select an option

Save lis186/9460594 to your computer and use it in GitHub Desktop.
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