You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// var Phidget = require('phidgetapi').Phidget;// var IK888=new phidget();// <--- in original code phidget() function is undefinedvarIK888=require('phidgetapi').Phidget();IK888.on("error",function(data){console.log('error ',data);});IK888.on('phidgetReady',function(){console.log('IK888 phidget ready');console.log(IK888.data);IK888.set({type:'Output',key:'0',value:'1'});IK888.on('changed',update);});varupdate=function(data){console.log('phidget state changed');console.log('data ',data);if(data.type=='Sensor'){IK888.set({type:'Output',key:'0',value:'1'});setTimeout(function(){// phidget.set({ <-- in original code phidget var is undefinedIK888.set({type:'Output',key:'0',value:'0'});},200);}};/** Connect to Phidget*/IK888.connect({type: 'PhidgetInterfaceKit'});
The text was updated successfully, but these errors were encountered:
On Mon, Mar 27, 2017 at 8:22 AM, alfalabs ***@***.***> wrote:
@RIAEvangelist <https://github.com/RIAEvangelist>
This API is great!
There is a small problem with sample code in docs: https://github.com/
RIAEvangelist/node-phidget-API/blob/master/docs/Phidget.md <http://url>
here is a fix:
var IK888 = require('phidgetapi').Phidget(); // <--- in original code phidget() function is undefined
IK888.on("error", function(data){ console.log('error ',data); });
IK888.on('phidgetReady', function(){
console.log('IK888 phidget ready');
console.log(IK888.data);
IK888.set({
type:'Output',
key:'0',
value:'1'
});
IK888.on('changed', update );
}
);
var update = function(data){
console.log('phidget state changed');
console.log('data ',data);
if(data.type=='Sensor'){
IK888.set({
type:'Output',
key:'0',
value:'1'
});
setTimeout( function(){
IK888.set({ // <-- in original code phidget var is undefined
type:'Output',
key:'0',
value:'0'
});
},
200
);
}
};
/** Connect to Phidget*/IK888.connect({type: 'PhidgetInterfaceKit' });
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#64>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAWhkSEWl_HDx7XBnifMlNJYl2PVxdzvks5rp9ROgaJpZM4MqbFr>
.
@RIAEvangelist
This API is great!
There is a small problem with sample code in docs: https://github.com/RIAEvangelist/node-phidget-API/blob/master/docs/Phidget.md
here is a fix:
The text was updated successfully, but these errors were encountered: