Skip to content

Instantly share code, notes, and snippets.

View 4rzael's full-sized avatar

4rzael 4rzael

  • Bordeaux, France
View GitHub Profile
@4rzael
4rzael / node.md
Last active March 23, 2016 18:12
Node.JS lightning talk

node

  • Node.JS, c'est quoi ?
    • execute du JS
    • Hors navigateur
    • même moteur que chrome : V8

v8

@4rzael
4rzael / .gitignore
Last active December 21, 2015 15:56
Rapport de stage chez Ants.
.~*#
*.old
@4rzael
4rzael / client.js
Created December 7, 2015 21:49
The logging version of MQTT client.js
'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,
@4rzael
4rzael / mcp3002.js
Created October 15, 2015 09:23
A litlle example code to read data from a MCP3002 on a RPi using pi-spi
'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;
@4rzael
4rzael / spi-errors
Last active December 19, 2015 23:43
node-spi errors
> [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
@4rzael
4rzael / sim908.md
Last active December 28, 2016 00:49
Use the SIM908 on odroidC1

How to use the SIM908 on an ODROID-C1

Automatic way :

  • Download the file sim908.sh

  • type sh sim908.sh in your terminal

Manual way :