Skip to content

Latest commit

 

History

History
69 lines (37 loc) · 1.23 KB

sensor-fsr.md

File metadata and controls

69 lines (37 loc) · 1.23 KB

Sensor Fsr

Run with:

node eg/sensor-fsr.js
var five = require("johnny-five"),
    fsr, led;

(new five.Board()).on("ready", function() {

  // Create a new `fsr` hardware instance.
  fsr = new five.Sensor({
    pin: "A0",
    freq: 25
  });

  led = new five.Led(9);

  // Scale the sensor's value to the LED's brightness range
  fsr.scale([ 0, 255 ]).on("read", function() {

    // set the led's brightness based on force
    // applied to force sensitive resistor

    led.brightness( this.value );
  });
});

Breadboard

docs/breadboard/sensor-fsr.fzz

Devices

Documentation

(Nothing yet)

Contributing

All contributions must adhere to the Idiomatic.js Style Guide, by maintaining the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

Release History

(Nothing yet)

License

Copyright (c) 2012 Rick Waldron waldron.rick@gmail.com Licensed under the MIT license.