Skip to content

Instantly share code, notes, and snippets.

@pingud98
pingud98 / Graphicequal
Created October 9, 2013 22:53
Graphic equaliser in processing (equalizer)
/**
Hacked together from the minim tutorial examples
**/
import ddf.minim.analysis.*;
import ddf.minim.*;
Minim minim;
//AudioPlayer jingle;
FFT fftLin;
@pingud98
pingud98 / SpectrumArdunio
Last active December 25, 2015 09:39
Firmata Spectrum Analyser, Processing 2.0 with Firmata
/**
Hacked together from the minim tutorial examples
runs with simple analogue firmata on arduino
**/
import ddf.minim.analysis.*;
import ddf.minim.*;
import cc.arduino.*;
import processing.serial.*;
@pingud98
pingud98 / photoboothbuttons.pde
Created December 26, 2013 23:35
trigger buttons for my wedding photo booth
int stbuttonPin = 2; // change to whatever you want
int tkbuttonPin = 3;
int ledPin = 13; // just using for example
boolean tkoldval = HIGH;
boolean stoldval = HIGH;
void setup()
{
pinMode(ledPin, OUTPUT); // LED as output
pinMode(stbuttonPin, INPUT); // button as input
@pingud98
pingud98 / helloworldlaser.pde
Created December 26, 2013 23:42
Arduino 2 axis laser projector 'Hello World' code
int xPinOne = 3;
int laserPin = 4;
int xPinTwo = 5;
int yPinOne = 6;
int yPinTwo = 9;
int zPinOne = 10;
int zPinTwo = 11;
@pingud98
pingud98 / laser alphabet.pde
Created December 26, 2013 23:43
laser alphabet: the alphabet for my primitive laser projector
int delayone = 2;
int delaytwo = 1;
int delaythree = 1;
int delayfour = 1;
int xPinOne = 3;
int laserPin = 4;
int xPinTwo = 5;
@pingud98
pingud98 / arduinopowerdemo.pde
Created December 26, 2013 23:44
arduino power demo 1 based on Analogue Devices ADE 7753 IC for more details http://arduinopower.pbworks.cc
//registers on ADE7753
#define WAVEFORM 0x01
#define AENERGY 0x02
#define RAENERGY 0x03
#define LAENERGY 0x04
#define VAENERGY 0x05
#define LVAENERGY 0x06
#define LVARENERGY 0x07
#define MODE 0x09
#define IRQEN 0x0A
@pingud98
pingud98 / ultimatearm2.pde
Created December 26, 2013 23:49
Processing code for my robot arm as demonstrated at Lift 11 NB the code in the arduino is just Firmata exposing the three servos
import processing.serial.*;
import cc.arduino.*;
Arduino arduino;
int countstart = 0;
int servo1Pin = 9; // Control pin for servo motor
int servo2Pin = 10; // Control pin for servo motor
int servo3Pin = 11; // Control pin for servo motor
int armposn;// = 0;
int digitposn;// = 0;
//int penposn;//= 0;
@pingud98
pingud98 / snowflake energy meter.pde
Created December 26, 2013 23:53
Snowflake power meter This code takes in pulses from an arduino over serial and draws a snowflake on the screen for each pulse. It also passes the values into a MySQL database, if you give it the right information. it needs the bezier sql library and the mysql library to work.
//Based on an example by Tom Igoe
PrintWriter output;
import processing.serial.*;
import de.bezier.data.sql.*;
//import SQLibrary.*; // mysql database library
int xrnd = 0;
int yrnd = 0;
PFont fontA;
int xbig = 1000;
int ybig = 768;
@pingud98
pingud98 / Robotboothpicture.py
Last active August 29, 2015 13:55
Robot Photobooth for Android (QR code input)
#now fixed to use the latest twitter API as of Feb 2014.
#runs fine on SL4A r6 with Python 2.6.2 and Tweepy 2 for python 2.6
import android
import tweepy
import time
droid=android.Android()
#droid.wakeLockAcquirePartial()
@pingud98
pingud98 / Talkingphotobooth.py
Created February 3, 2014 14:54
Robot Photobooth for Android- Talking part
#witty things for your android phone to say whilst it's pretending to be a photo booth.
#run as a background script to avoid any thread clashes/multitasking issues with the main photo taking script
#written for python in SL4A
import android, time, random
runcontinuous = True
droid=android.Android()
dialogues = {0 : "Hello, I'm the robot photo booth! Please show me your QR codes and I will take your picture and tweet it back to you. Please put your QR code in front of the camera now",
1: "I can't see your QR code properly, is it upside down?",