config_files/hello-world-leds.js
// formats an input to be received by a tri-color gpio led
formats an input to be received by a tri-color gpio led
formats an input to be received by a tri - color gpio led
function triGpioColor(c) {
   if(c === 1) return 1;
   if(c === 0) return 0;
   var isArray = Array.isArray(c);
   if(isArray && this._component.name === 'red') return c[0] === 255 ? 1 : 0;
   if(isArray && this._component.name === 'blue') return c[1] === 255 ? 1: 0;
   if(isArray && this._component.name === 'green') return c[2] === 255 ? 1: 0;
   return c;
}
function triGpioColor ( c ) { if ( c === 1 ) return 1 ; if ( c === 0 ) return 0 ; var isArray = Array . isArray ( c ) ; if ( isArray && this . _component . name === 'red' ) return c [ 0 ] === 255 ? 1 : 0 ; if ( isArray && this . _component . name === 'blue' ) return c [ 1 ] === 255 ? 1 : 0 ; if ( isArray && this . _component . name === 'green' ) return c [ 2 ] === 255 ? 1 : 0 ; return c ; }
formats an input to be received by a tri-color gpio led
formats an input to be received by a tri - color gpio led