Installer node.js
wget http://node-arm.herokuapp.com/node_latest_armhf.deb
sudo dpkg -i node_latest_armhf.deb
Activer le module SPI: http://itechnofrance.wordpress.com/2013/06/22/activer-le-support-du-bus-spi-sur-le-raspberry/
Redemarrer
| erase: | |
| sudo dfu-programmer atmega16u2 erase | |
| reset: | |
| sudo dfu-programmer atmega16u2 reset | |
| hiduino: | |
| sudo dfu-programmer atmega16u2 flash firmwares/HIDUINO_MIDI.hex | |
| usbuno: |
| var app = { | |
| // Application Constructor | |
| initialize: function() { | |
| this.bindEvents(); | |
| }, | |
| // Bind Event Listeners | |
| // | |
| // Bind any events that are required on startup. Common events are: | |
| // 'load', 'deviceready', 'offline', and 'online'. | |
| bindEvents: function() { |
Installer node.js
wget http://node-arm.herokuapp.com/node_latest_armhf.deb
sudo dpkg -i node_latest_armhf.deb
Activer le module SPI: http://itechnofrance.wordpress.com/2013/06/22/activer-le-support-du-bus-spi-sur-le-raspberry/
Redemarrer
| #include <SPI.h> | |
| #include <DMD.h> | |
| #include <TimerOne.h> | |
| #include <Arial_black_16.h> | |
| // DMD stuff | |
| #define DISPLAYS_ACROSS 5 | |
| #define DISPLAYS_DOWN 1 | |
| DMD dmd(DISPLAYS_ACROSS, DISPLAYS_DOWN); |
| /* | |
| * | |
| * ArialBlack16 | |
| * | |
| * created with FontCreator | |
| * written by F. Maximilian Thiele | |
| * | |
| * http://www.apetech.de/fontCreator | |
| * me@apetech.de |
| var fs = require('fs'), | |
| parser = require('subtitles-parser'), | |
| i = 0, | |
| srt, | |
| current; | |
| fs.readFile('srt/folie.srt', 'utf-8', function(err, data) { | |
| if (err) throw err; | |
| srt = parser.fromSrt(data, true); | |
| readNext(); |
| No. Time Source Destination Protocol Length Info | |
| 180 5.515126000 54.83.198.224 192.168.1.11 HTTP 1348 HTTP/1.1 302 FOUND (text/html) | |
| Frame 180: 1348 bytes on wire (10784 bits), 1348 bytes captured (10784 bits) on interface 0 | |
| Ethernet II, Src: FreeboxS_af:31:6f (00:24:d4:af:31:6f), Dst: AsustekC_d5:23:af (c8:60:00:d5:23:af) | |
| Internet Protocol Version 4, Src: 54.83.198.224 (54.83.198.224), Dst: 192.168.1.11 (192.168.1.11) | |
| Transmission Control Protocol, Src Port: http (80), Dst Port: 57999 (57999), Seq: 1, Ack: 295, Len: 1282 | |
| Hypertext Transfer Protocol | |
| HTTP/1.1 302 FOUND\r\n | |
| cache-control: no-cache\r\n |
| #include "LPD8806.h" | |
| #include "SPI.h" | |
| // nb led pour le total de tubes | |
| // - 144 leds par tube, leds adressable 3 par 3, et 3 leds pour un RGB, donc 144/9= 16 leds RGB en equivalence) | |
| // - dans ce cas, il y a 7 tubes : 16 led RGB en equivalance * 7 = 112 | |
| int nLEDs = 112; | |
| // pin de donnée et de clock | |
| int dataPin = 12; |
| #include "Planet.h" | |
| const int MIN_MEASURE = 30; | |
| const int MAX_MEASURE = 350; | |
| const int MIN_MAP = 0; | |
| const int MAX_MAP = 127; | |
| const int NUMBER_OF_MEASURES = 50; | |
| Planet::Planet(int irPin, int ledPin, int controller) : _irPin(irPin), _ledPin(ledPin), _controller(controller), _previousValue(0), _smoother(new RunningMedian(99)) { | |
| pinMode(irPin, INPUT); |