Skip to content

Instantly share code, notes, and snippets.

View smukkejohan's full-sized avatar

Johan Bichel Lindegaard smukkejohan

View GitHub Profile
@smukkejohan
smukkejohan / mp3trigger.pde
Created August 18, 2011 00:25
The Architecture Run CPH 2011 - Arduino touch mp3trigger
// Johan Bichel Lindegaard 2011 http://johan.cc
// mp3trigger controller, 3 analog inputs controls 3 digital outputs
const int MP3TRIGGERPINS[] = {4,7,8}; // digital output pins for our
const int SENSORPINS[] = {A3,A4,A5};
const int THRESHOLDS[] = {100,100,100}; // threshold values to decide when the detected value is someone stepping on the sensor
const int TIMEOUTS[] = {1000,1000,1000}; // how long to wait for mp3triggers to finish playing their tracks
// these variables will change:
@smukkejohan
smukkejohan / nagios
Created February 6, 2012 19:07
Nagios with Nginx configuration
server {
listen 80;
server_name nagios.example.tld;
access_log /var/log/nginx/nagios.access.log;
error_log /var/log/nginx/nagios.error.log info;
expires 31d;
root /usr/share/nagios3/htdocs;
@smukkejohan
smukkejohan / chaossearh.py
Created February 20, 2012 22:26
Python port of Paul Bourke's random strange attractor generator using lyapunov exponents
# Python port of Paul Bourke's http://local.wasp.uwa.edu.au/~pbourke/fractals/lyapunov/gen.c
# By Johan Bichel Lindegaard - http://johan.cc
import math
import random
from PIL import Image, ImageDraw
import argparse
import os
parser = argparse.ArgumentParser(description='Search for chaos.')
data = [
{
"key" : "Work" ,
"values" : [
[ 1 , 0],
[ 2 , 11],
[ 3 , 0],
[ 4 , 9.5],
[ 5 , 0],
[ 6 , 0],
@smukkejohan
smukkejohan / jemm.ino
Last active December 16, 2015 17:09
Jemm
/*
* WiFlyHQ Example httpclient_progmem.ino
*
* This sketch implements a simple Web client that connects to a
* web server, sends a GET, and then sends the result to the
* Serial monitor.
*
* This example uses PROGMEM to reduce the amount of RAM needed
* for the sketch. Most of the strings are stored in flash rather than RAM.
*
@smukkejohan
smukkejohan / mp3player.ino
Last active December 16, 2015 17:09
Simple MP3 Player. Just a start and a stop button. - Written for Da Far Fik Bil exhibition.
boolean playing = false;
int playBtn = 10;
int stopBtn = 11;
int playInd = 12;
int stopInd = 13;
int statusPin = 2;
@smukkejohan
smukkejohan / lanterns
Last active December 21, 2015 14:49
Burning Man Lanterns - Lost Connections
#include <lightuino5.h>
static int lantern_number=8; // number of lanterns
float x1,y1,x2,y2,persistence;
int octaves;
int i=0,val,volume;
int numPatterns = 6; // store the number of patterns
int currentPattern=0; // the current pattern being shown on the LEDs
#include "ofMain.h"
#include "ofAppGlutWindow.h"
class testApp : public ofBaseApp {
public:
ofImage img;
ofPoint corners[4];
int selectedCorner;
HEADER_SEARCH_PATHS = (
"$(OF_CORE_HEADERS)",
../../../addons/ofx3DModelLoader/libs,
../../../addons/ofx3DModelLoader/src,
../../../addons/ofx3DModelLoader/src/3DS,
../../../addons/ofxAssimpModelLoader/libs,
../../../addons/ofxAssimpModelLoader/libs/assimp,
../../../addons/ofxAssimpModelLoader/libs/assimp/include,
../../../addons/ofxAssimpModelLoader/libs/assimp/include/Compiler,
../../../addons/ofxAssimpModelLoader/libs/assimp/lib,
@smukkejohan
smukkejohan / gist:8366353
Created January 11, 2014 02:47
Ribbon 3d
#include "testApp.h"
#include "ofxStereoCamera.h"
#include <OpenGL/OpenGL.h>
// Syphon together with 3D primitive and NoFill does not run
const int width = 1280;
const int height = 720;
ofxStereoCamera<ofEasyCam> cam;