npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

camera-vc0706

v0.1.8

Published

Library to run the camera-vc0706 Tessel module

Downloads

31

Readme

#Camera Driver for the camera-vc0706 Tessel camera module. The hardware documentation for this module can be found here.

If you run into any issues you can ask for support on the Camera Module Forums.

###Installation

npm install camera-vc0706

###Example

/*********************************************
This camera example takes a picture. If a
directory is specified with the --upload-dir
flag, the picture is saved to that directory.
*********************************************/

var tessel = require('tessel');
var camera = require('camera-vc0706').use(tessel.port['A']); 

var notificationLED = tessel.led[3]; // Set up an LED to notify when we're taking a picture

// Wait for the camera module to say it's ready
camera.on('ready', function() {
  notificationLED.high();
  // Take the picture
  camera.takePicture(function(err, image) {
    if (err) {
      console.log('error taking image', err);
    } else {
      notificationLED.low();
      // Name the image
      var name = 'picture-' + Math.floor(Date.now()*1000) + '.jpg';
      // Save the image
      console.log('Picture saving as', name, '...');
      process.sendfile(name, image);
      console.log('done.');
      // Turn the camera off to end the script
      camera.disable();
    }
  });
});

camera.on('error', function(err) {
  console.error(err);
});

###Properties # camera.resolutions() An object which maps resolution labels to their dimensions. The string labels can be used to configure the camera's resolution.

###Methods # camera.disable() Disable UART connection to camera. Closes connection & ends process.

# camera.setCompression( compressionFactor, callback(err) ) Determine the amount of compression on each image. Should be a number between 0 and 1. Default is 0.2. Note that the compression is saved in Flash and will be persistent between power cycles.

# camera.setResolution( resolution, callback(err) ) Set  the size of images. Options are 'vga' (640x480), 'qvga'(320x240) or  'qqvga' (160x120 ). Default is 'vga'. Note that the resolution is saved in Flash and will be persistent between power cycles.

# camera.takePicture( callback(err, picture) ) Take a still picture. Returns raw buffer data which you can pipe into a raw http stream or save in memory.

###Events # camera.on( 'compression', callback(xyz) ) Emitted when compression is set.

# camera.on( 'error', callback(err) ) Emitted upon error.

# camera.on( 'picture', callback(picture) ) Emitted when a photo is taken. Returns buffer of image.

# camera.on( 'ready', callback() ) Emitted upon first successful communication between the Tessel and the module.

# camera.on( 'resolution', callback(resolution) ) Emitted when resolution is set.

###Configuration In addition to the camera.setCompression() and camera.setResolution() methods, the camera can be configured at creation with an optional configuration object paremeter in the .use() method.

var tessel = require('tessel');
var camera = require('camera-vc0706').use(
  tessel.port['A'], {
      compression: 0.2, 
      resolution: 'vga'
  }
);

###Further Examples

  • Camera Options. This camera example sets image resolution and compression and then takes a picture. If a directory is specified with the --upload-dir flag, the picture is saved to that directory.

###License MIT or Apache 2.0, at your option