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
| #!/bin/bash | |
| #Installing Mraa | |
| clear | |
| echo "Beginning install!" | |
| sleep 1 | |
| mkdir buildMraa | |
| cd buildMraa | |
| checkCmake="1" | |
| #Check if Cmake exists |
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 ngrok = require('ngrok'); //ngrok | |
| var engine = require('express-dot-engine'); //Template engine | |
| 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 |
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('[[= model.url]]'); | |
| $('#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 HID = require('node-hid'); | |
| var devices = HID.devices(); | |
| var joystick; | |
| var map = { | |
| 26 : 'up', | |
| 27 : 'down', | |
| 4 : 'left', | |
| 7 : 'right', | |
| 0 : 'center', | |
| 28 : 'x', |
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 childProcess = require('child_process'); | |
| //take a snapshot using the webcam with ffmpeg | |
| childProcess.exec('/home/root/bin/ffmpeg/ffmpeg -loglevel panic -y -s 320x240 -f video4linux2 -i /dev/video0 -vframes 1 ./capture.jpeg'); | |
| /*********************************************************** | |
| ffmpeg flags: | |
| * -loglevel - set the logging level used by the library | |
| * -y - overwrite output files without asking | |
| * -s - set frame size WxH | |
| * -f - force format |
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
| $ sudo usermod -a -G dialout <username> |
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
| The TX/RX LEDs on the Pro Micro uses the pins PD5 and PB0. | |
| You can remove the resistors and use these pins, but you will need to first redefine the TXLED/RXLED pins. | |
| In OS X: | |
| /Users/USERNAME/Library/Arduino15/packages/SparkFun/hardware/avr/1.1.3/variants/promicro/pins_arduino.h | |
| Change these values: | |
| #define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0) | |
| #define TXLED0 PORTD |= (1<<5) | |
| #define TXLED1 PORTD &= ~(1<<5) |
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
| ./ffserver & | |
| ./ffmpeg -r 25 -s 640x480 -f video4linux2 -i /dev/video0 http://localhost:8090/feed1.ffm |
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
| 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 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'); | |
| var temperature = $('#temperature'); | |
| socket.on('temperature',function(data){ | |
| temperature.html(data.celsius); |