Skip to content

Latest commit

 

History

History

photoresistor

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Ejemplo Fotorresistencia

Cableado

cableado fotorresitencia

Código

const five = require('johnny-five');

const board = new five.Board();

board.on('ready', () => {
  const photoresistor = new five.Sensor({
    pin: 'A2',
    freq: 250
  });

  photoresistor.on('change', function onChange() {
    console.log(this.value);
  });

  photoresistor.on('data', function onData() {
    console.log(this.value);
  });
});

Referencia de la API

Sensores