Skip to content

Instantly share code, notes, and snippets.

@sivieri
sivieri / config
Created June 1, 2013 16:13
crosstool-ng configuration file for Kindle 4 NT
#
# Automatically generated make config: don't edit
# crosstool-NG 1.18.0 Configuration
# Fri May 31 16:14:55 2013
#
CT_CONFIGURE_has_xz=y
CT_CONFIGURE_has_svn=y
CT_MODULES=y
#
@sivieri
sivieri / mnemonics.erl
Created September 6, 2012 10:33
Phone mnemonics in Erlang
-module(mnemonics).
-export([translate/1]).
-define(MNEMONICS, [{2, "ABC"}, {3, "DEF"}, {4, "GHI"}, {5, "JKL"}, {6, "MNO"}, {7, "PQRS"}, {8, "TUV"}, {9, "WXYZ"}]).
-define(WORDS, []).
% Public API
translate(StringNumber) ->
Result2 = encode(StringNumber, fun(X) -> sets:to_list(sets:from_list(slab(X))) end),
Result = sets:from_list(Result2),
@sivieri
sivieri / SDWebBrowse.pde
Created November 30, 2011 11:23
Arduino Web Server
#include <SdFat.h>
#include <SdFatUtil.h>
#include <SPI.h>
#include <Ethernet.h>
//#include <EthernetDHCP.h>
#include <LiquidCrystal.h>
#include <string.h>
#define BUFSIZ 100
@sivieri
sivieri / midiTheremin.cpp
Created August 31, 2011 15:09
Code for reading from two IR proximity sensors with Arduino and outputting their values as MIDI CC
/*
Copyright (c) 2011 Alessandro Sivieri <alessandro.sivieri@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License version 3 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@sivieri
sivieri / FrameDifferencingDump.java
Created August 19, 2011 10:30
Processing.org and GSVideo: capture, frame difference and dump
import codeanticode.gsvideo.*;
int numPixels;
int[] previousFrame;
GSCapture video;
GSMovieMaker mm;
int fps = 15;
void setup() {
size(640, 480);
@sivieri
sivieri / midi_leds.ino
Created February 8, 2015 17:39
MIDI reader
#include <MIDI.h>
#define NOTES 26
#define OCTAVE_LENGTH 12
#define BASELINE 43
#define CHANNELS 3
int latchPin1 = 8;
int clockPin1 = 12;
int dataPin1 = 11;