This file contains 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'); //require mraa | |
console.log('MRAA Version: ' + m.getVersion()); //write the mraa version to the console | |
var myLed = new m.Gpio(13); //LED hooked up to digital pin 13 (or built in pin on Galileo Gen1 & Gen2) | |
myLed.dir(m.DIR_OUT); //set the gpio direction to output | |
var ledState = true; //Boolean to hold the state of Led | |
periodicActivity(); //call the periodicActivity function | |
function periodicActivity() |
This file contains 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 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 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 exec = require('child_process').exec; | |
//var dgram = require('dgram'); | |
//var client = dgram.createSocket('udp4'); | |
var groveSensor = require('jsupm_grove'); | |
var loudnessSensor = require('jsupm_groveloudness'); | |
var touchModule = require('jsupm_ttp223'); | |
var vibrationModule = require('jsupm_ldt0028'); | |
var LCD = require('jsupm_i2clcd'); | |
var digitalAccelerometer = require('jsupm_mma7660'); |
This file contains 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
{ | |
"name": "sample", | |
"description": "", | |
"version": "0.0.0", | |
"main": "index.js", | |
"engines": { | |
"node": ">=0.10.0" | |
}, | |
"dependencies": { | |
} |
This file contains 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
wget --no-check-certificate https://raw.githubusercontent.com/intel-iot-devkit/upm/master/examples/javascript/grovetemp.js && node grovetemp.js |
This file contains 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 groveSensor = require('jsupm_grove'); //UPM sensor | |
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 tempSensor = new groveSensor.GroveTemp(0); //temperature sensor connected to analog pin 0 | |
app.get('/', function(req, res) { | |
res.sendfile(__dirname + '/index.html'); //serve the static html file | |
}); |
This file contains 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'); | |
var temperature = $('#temperature'); | |
socket.on('temperature',function(data){ | |
temperature.html(data.celsius); |
This file contains 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
HTTPPort 8090 | |
# bind to all IPs aliased or not | |
HTTPBindAddress 0.0.0.0 | |
# max number of simultaneous clients | |
MaxClients 1000 | |
# max bandwidth per-client (kb/s) | |
MaxBandwidth 10000 | |
<Feed feed1.ffm> | |
File /tmp/feed1.ffm |
This file contains 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
./ffserver & | |
./ffmpeg -r 25 -s 640x480 -f video4linux2 -i /dev/video0 http://localhost:8090/feed1.ffm |
OlderNewer