Skip to content

Instantly share code, notes, and snippets.

@fauria
fauria / gist:3dd003f6570ae241afe8
Created October 5, 2015 11:21
spi build error
root@raspberrypi:/home/pi/sources/nodejs-examples# npm install spi
-
> spi@0.2.0 install /home/pi/sources/nodejs-examples/node_modules/spi
> node-gyp rebuild
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/0.10.40"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/pi/sources/nodejs-examples/node_modules/spi/.node-gyp"
make: Entering directory '/home/pi/sources/nodejs-examples/node_modules/spi/build'
CXX(target) Release/obj.target/_spi/src/spi_binding.o
In file included from ../src/spi_binding.cc:19:0:
# From: http://stackoverflow.com/a/8842339
#
# generic AVR makefile
#
# (c) July 2011 - Manuel Odendahl - wesen@ruinwesen.com
#
# include this into your main Makefile, after having defined TARGET and TARGET_OBJS
all: $(TARGET).hex
@fauria
fauria / dual-spdt-switch-example.ino
Created March 23, 2016 10:28
Sample code for the Grove Protoshield Dual SPDT Switch
// Plugged to socket D4
int leftSwitch = 4;
int rightSwitch = 5;
void setup() {
Serial.begin(9600);
}
void loop() {
String switchStatus = (String)digitalRead(leftSwitch)+(String)digitalRead(rightSwitch);