var vibration = '';
function setVibration( val ) { ....vibration = val; }
function updateLed( sensorPin, ledPin ) { ....//get state for vibration sensor and store it ....digitalReadHandler( sensorPin, setVibration ); ....//vibration now holds either HIGH/LOW ....//accordingly update the led ....digitalWrite( ledPin, vibration ) }