Skip to content

Instantly share code, notes, and snippets.

@isma44
Created February 21, 2015 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isma44/9c1d19e646afb68d9f0e to your computer and use it in GitHub Desktop.
Save isma44/9c1d19e646afb68d9f0e to your computer and use it in GitHub Desktop.
Ricoh Theta Test by Node.js
// for Mac
// module.paths.push('/usr/local/lib/node_modules');
var Theta = require('ricoh-theta');
var theta = new Theta();
theta.connect('192.168.1.5');
// capture
theta.on('connect', function(){
theta.capture(function(err){
if(err) return console.error(err);
console.log('capture success');
});
});
// get picture
theta.on('objectAdded', function(object_id){
theta.getPicture(object_id, function(err, picture){
fs.writeFile('tmp.jpg', picture, function(err){
console.log('picture saved => tmp.jpg');
theta.disconnect();
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment