コード例 #1
0
ファイル: test-wiringpi.js プロジェクト: ayumin/mc-device
**
*/

var wiringpi = require( 'node-wiringpi' );

var RED_PIN = 4
var GREEN_PIN = 25;
var BLUE_PIN  = 23;

var SWITCH_PIN = 24; 

var MCP_CHANNEL =  0;
var MCP_FREQUENCY = 100000;
var TEMP_CHANNEL = 7;

wiringpi.pin_mode( RED_PIN, wiringpi.PIN_MODE.OUTPUT );
wiringpi.pin_mode( BLUE_PIN, wiringpi.PIN_MODE.OUTPUT );
wiringpi.pin_mode( GREEN_PIN, wiringpi.PIN_MODE.OUTPUT );

if(wiringpi.setup_spi(MCP_CHANNEL, MCP_FREQUENCY) == -1){
  console.log("MCP setup error")
  process.exit(1)
}

var HIGH = wiringpi.WRITE.HIGH;
var LOW  = wiringpi.WRITE.LOW;

var pins = [4,23,25];
var pattern = [
  [ LOW , LOW , LOW  ],
  [ LOW , LOW , HIGH ],
コード例 #2
0
var secucard = new Secucard({
  auth: {
      client_id: '611c00ec6b2be6c77c2338774f50040b',
      client_secret: 'dc1f422dde755f0b1c4ac04e7efbd6c4c78870691fe783266d7d6c89439925eb',
      vendor: 'secucard',
      uuid: '/vendor/secucard/relais/1',
      refresh_token: "09acadd3044e42804941dcb94051250eae7d096d",
      expires_in: 9000000
  },
  debug: true,
  //environment: 'dev'
  environment: 'prod'
});


wpi.pin_mode( 6, wpi.PIN_MODE.OUTPUT );

// Events
/*
onStompConnected
onStompDisconnect
onDeviceCodeAuthorizationPending
onDeviceCodeAuthorizationSuccess
onDeviceAuthorizationError
onDeviceAuthorizationSuccess
onMessage
*/



secucard.on('onMessage', function(msg) {