var sensor = require('@amperka/light-sensor').connect(A2); var startTime = getTime(); setInterval(function() { var lx = sensor.read('lx').toFixed(0); var time = (getTime() - startTime).toFixed(0); console.log(time, 'sec', '->', lx, 'luxes'); }, 1000);