- Node.JS, c'est quoi ?
- execute du JS
- Hors navigateur
- même moteur que chrome : V8
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
.~*# | |
*.old |
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
'use strict'; | |
/** | |
* Module dependencies | |
*/ | |
/*global setImmediate:true*/ | |
var events = require('events'), | |
Store = require('./store'), | |
eos = require('end-of-stream'), | |
mqttPacket = require('mqtt-packet'), | |
Writable = require('readable-stream').Writable, |
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
'use strict'; | |
var SPI = require('pi-spi'); | |
var spi = SPI.initialize("/dev/spidev0.0"); | |
// Read value from a MCP3002 (http://ww1.microchip.com/downloads/en/DeviceDoc/21294C.pdf) | |
function readMCP(channel, callback) { | |
if (spi === undefined) return; | |
var mode = (8 + channel) << 4; |
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
> [email protected] install /home/pi/mcp/node_modules/spi | |
> node-gyp rebuild | |
make: Entering directory '/home/pi/mcp/node_modules/spi/build' | |
CXX(target) Release/obj.target/_spi/src/spi_binding.o | |
In file included from ../src/spi_binding.cc:19:0: | |
../src/spi_binding.h:47:9: error: ‘FunctionCallbackInfo’ does not name a type | |
../src/spi_binding.h:47:9: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive] | |
../src/spi_binding.h:47:9: error: expected ‘,’ or ‘...’ before ‘<’ token | |
../src/spi_binding.h:48:9: error: ‘FunctionCallbackInfo’ does not name a type |
NewerOlder