exports.connect=function(a,b){var c=0,d=a,f=null,g=20,h=0,i=1;return b&&'undefined'!=typeof b.min_pulse&&(h=b.min_pulse),b&&'undefined'!=typeof b.max_pulse&&(i=b.max_pulse),b&&'undefined'!=typeof b.interval_time&&(g=b.interval_time),b&&'undefined'!=typeof b.pos&&(c=E.clip(b.pos*i,h,i)),{init:function(j){var k=10,l=this;f=setInterval(function(){0<k?(digitalPulse(d,1,c),k--):(l.stop(),j&&j())},g)},move:function(j,k,l,m){null!==f&&this.stop();var o,n=E.clip(j*i,h,i).toFixed(2),p=1e3/g*(k/1e3),q=this,r='cw',s=5e3;return n=parseFloat(n),null===d?(m&&m({success:!1,details:'servo not initialized'}),!1):void(c>n?(o=c-n,r='ccw'):c<n?(o=n-c,r='cw'):(o=0,r=''),f=setInterval(function(){if('cw'==r?c+=o/p:c-=o/p,c=E.clip(parseFloat(c.toFixed(2)),h,i),c<n&&'cw'==r||c>n&&'ccw'==r)digitalPulse(d,1,c);else if(q.stop(),c=n,!0===l)q.holdPos(l,m),m&&m({success:!0,pos:c});else if(0<l)q.holdPos(l,m);else return m&&m({success:!0,pos:c}),!0;s--,0>=s&&q.stop()},g))},holdPos:function(j,k){var l=0,m=this;f=setInterval(function(){return l+=g,l>=j&&!0!==j?(m.stop(),k&&k({success:!0,pos:c}),!0):void digitalPulse(d,1,c)},g)},getPos:function(){return parseFloat((c/i).toFixed(2))},stop:function(){try{clearInterval(f),f=null}catch(j){console.log('clearInterval Error')}}}};

exports.connect=function(a,b){var c=0,d=a,f=null,g=20,h=0,i=1;return b&&'undefined'!=typeof b.min_pulse&&(h=b.min_pulse),b&&'undefined'!=typeof b.max_pulse&&(i=b.max_pulse),b&&'undefined'!=typeof b.interval_time&&(g=b.interval_time),b&&'undefined'!=typeof b.pos&&(c=E.clip(b.pos*i,h,i)),{init:function(j){var k=30,l=this;f=setInterval(function(){0<k?(digitalPulse(d,1,c),k--):(l.stop(),j&&j())},g)},move:function(j,k,l,m){null!==f&&this.stop();var o,n=E.clip(j*i,h,i).toFixed(2),p=1e3/g*(k/1e3),q=this,r='cw',s=5e3;return n=parseFloat(n),null===d?(m&&m({success:!1,details:'servo not initialized'}),!1):void(c>n?(o=c-n,r='ccw'):c<n?(o=n-c,r='cw'):(o=0,r=''),f=setInterval(function(){if('cw'==r?c+=o/p:c-=o/p,c=E.clip(parseFloat(c.toFixed(2)),h,i),c<n&&'cw'==r||c>n&&'ccw'==r)digitalPulse(d,1,c);else if(q.stop(),c=n,!0===l)q.holdPos(l,m),m&&m({success:!0,pos:c});else if(0<l)q.holdPos(l,m);else return m&&m({success:!0,pos:c}),!0;s--,0>=s&&q.stop()},g))},holdPos:function(j,k){var l=0,m=this;f=setInterval(function(){return l+=g,l>=j&&!0!==j?(m.stop(),k&&k({success:!0,pos:c}),!0):void digitalPulse(d,1,c)},g)},getPos:function(){return parseFloat((c/i).toFixed(2))},stop:function(){try{clearInterval(f),f=null}catch(j){console.log('clearInterval Error')}}}};

Update servoxt.min.js