var on = false; var change = function() { on = !on; LED1.write(on); }; setWatch(change, BTN1, {repeat:true, edge:"rising"});