lib/gpio.js
function(path, interval, fn) {
	if(typeof fn === 'undefined') {
		fn = interval;
		interval = 100;
	}
	if(typeof interval !== 'number') return false;
	if(typeof fn !== 'function') return false;

	var value;
	var readTimer = setInterval(function() {
		_read(path, function(val) {
			if(value !== val) {
				if(typeof value !== 'undefined') fn(val);
				value = val;
			}
		});
	}, interval);

	this.stop = function() { clearInterval(readTimer); };
}
function(path, interval, fn) {
	if(typeof fn === 'undefined') {
		fn = interval;
		interval = 100;
	}
	if(typeof interval !== 'number') return false;
	if(typeof fn !== 'function') return false;

	var value;
	var readTimer = setInterval(function() {
		_read(path, function(val) {
			if(value !== val) {
				if(typeof value !== 'undefined') fn(val);
				value = val;
			}
		});
	}, interval);

	this.stop = function() { clearInterval(readTimer); };
}
function ( path , interval , fn ) { if ( typeof fn === 'undefined' ) { fn = interval ; interval = 100 ; } if ( typeof interval !== 'number' ) return false ; if ( typeof fn !== 'function' ) return false ; var value ; var readTimer = setInterval ( function ( ) { _read ( path , function ( val ) { if ( value !== val ) { if ( typeof value !== 'undefined' ) fn ( val ) ; value = val ; } } ) ; } , interval ) ; this . stop = function ( ) { clearInterval ( readTimer ) ; } ; }
fs.watch doesn't get fired because the file never gets 'accessed' when setting header via hardware manually watching value changes
fs . watch doesn t get fired because the file never gets accessed when setting header via hardware manually watching value changes