examples/pfio.inputs.changed.js
function watchInputs() {
	var state;
	state = pfio.read_input();
	if (state !== prev_state) {
		EventBus.emit('pfio.inputs.changed', state, prev_state);
		prev_state = state;
	}
	setTimeout(watchInputs, 10);
}
function watchInputs() {
	var state;
	state = pfio.read_input();
	if (state !== prev_state) {
		EventBus.emit('pfio.inputs.changed', state, prev_state);
		prev_state = state;
	}
	setTimeout(watchInputs, 10);
}
function watchInputs ( ) { var state ; state = pfio . read_input ( ) ; if ( state !== prev_state ) { EventBus . emit ( 'pfio.inputs.changed' , state , prev_state ) ; prev_state = state ; } setTimeout ( watchInputs , 10 ) ; }
Watches for state changes
Watches for state changes