This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var five = require("../"); | |
| var board = new five.Board(); | |
| board.on("ready", function() { | |
| var ADDRESS = 0x62; | |
| var ENABLE = 0x00; | |
| var MEASUREMODE = 0x04; | |
| var READREGISTER = 0x8f; | |
| var BYTES_TO_READ = 0x02; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
| <script src="https://cdn.socket.io/socket.io-1.2.1.js"></script> | |
| <script> | |
| $(function(){ | |
| var socket = io.connect('http://INTEL_EDISON_IP_ADDRESS:3000'); | |
| $('#slider').on('input change',function(){ | |
| socket.emit('changeBlinkInterval',$(this).val()); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var m = require('mraa'); //IO Library | |
| var app = require('express')(); //Express Library | |
| var server = require('http').Server(app); //Create HTTP instance | |
| var io = require('socket.io')(server); //Socket.IO Library | |
| var blinkInterval = 1000; //set default blink interval to 1000 milliseconds (1 second) | |
| var ledState = 1; //set default LED state | |
| var myLed = new m.Gpio(13); //LED hooked up to digital pin 13 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function go() { | |
| var userId = prompt('Username?', 'Guest'); | |
| var userData = { name: userId }; | |
| tryCreateUser(userId, userData); | |
| } | |
| var USERS_LOCATION = 'https://SampleChat.firebaseIO-demo.com/users'; | |
| function userCreated(userId, success) { | |
| if (!success) { |