Skip to content

Instantly share code, notes, and snippets.

/*
Connect SCLK, MISO, MOSI, and CSB of ADXL362 to
SCLK, MISO, MOSI, and DP 10 of Arduino
(check http://arduino.cc/en/Reference/SPI for details)
*/
#include <SPI.h>
@annem
annem / gist:73b2a8ff65063cb29024
Last active August 29, 2015 14:07
Notes from js meetup - Oct 7
function times(x){
return function(y) {
return(x*y);
}
}
//the value you pass in for x will always be trapped in the closure function.
// terminology
// Partial appliction
#include <Esplora.h>
#include <ScratchSensors.h>
ScratchSensors Scratchboard;
void setup() {
Scratchboard.init();
}
void loop() {
// include Esplora library functions
#include <Esplora.h>
// declare variables used to store sensor data
int hammer;
int left;
// setup() block
// All lines in between { and } are part of the setup block, and run once, at the beginning
#include <Esplora.h>
int hammer;
int left;
void setup() {
Serial.begin(9600);
Keyboard.begin();
}
void loop() {
#include <Esplora.h>
int light;
int temp;
int slider;
void setup() {
Serial.begin(9600);
Keyboard.begin();
}
@annem
annem / gist:3183536
Created July 26, 2012 18:01 — forked from petrockblog/gist:3051568
Download, compile, and install the Broadcom BCM 2835 library for the Raspberry Pi
cd;
// wget http://www.open.com.au/mikem/bcm2835/bcm2835-1.5.tar.gz; // My Pi can't figure out this URL
wget http://67.192.60.197/mikem/bcm2835/bcm2835-1.5.tar.gz
tar xvfz bcm2835-1.5.tar.gz;
cd bcm2835-1.5;
./configure;
make;
sudo make install