Skip to content

Instantly share code, notes, and snippets.

View ulrichzwingli's full-sized avatar

ulrichzwingli

View GitHub Profile
/*
*/
void setup() {
Serial.begin(9600);
pinMode(2,INPUT);
}
void loop() {
@ulrichzwingli
ulrichzwingli / gist:746a2933aef0fe929849619bb7ff5b2b
Created October 7, 2017 21:12
3 Potentiometer Arduino to P5 (P5 Sketch)
var serial; // variable to hold an instance of the serialport library
var portName = '/dev/cu.usbmodem1411'; // fill in your serial port name here
var inData;
var pot1;
var pot2;
var pot3;
//var circleColor = 255;
function setup() {
createCanvas(600, 400);
@ulrichzwingli
ulrichzwingli / gist:2c94958570bc32488ec97ef8d1c9346e
Created October 7, 2017 21:38
3 Potentiometer Arduino Code
/*
*/
void setup() {
Serial.begin(9600);
pinMode(7,INPUT);
}
void loop() {
var serial; // variable to hold an instance of the serialport library
var portName = '/dev/cu.usbmodem1431'; // fill in your serial port name here
var inData;
var pot1;
var pot2;
var pot3;
var songon = 0;
var flag = 0;
var whatever1 = 0;
var whatever2 = 0;
var serial; // variable to hold an instance of the serialport library
var portName = '/dev/cu.usbmodem1411'; // fill in your serial port name here
var pot1;
var pot2;
var pot3;
var button1;
var whatever1 = 0;
var whatever2 = 0;
var whatever3 = 0;
var whatever4 = 0;
var balls = [];
var angle = [0,30,60,90,120,150,180,210,240,270,300,330];
function setup() {
createCanvas(400,400);
for(i=0; i<12; i++) {
balls[i] = new Cracker();
}
}
@ulrichzwingli
ulrichzwingli / gist:5f1fcb8373d9fceb06ac8b80a2f58446
Created October 13, 2017 04:35
fire_cracker_when_Mouse_Pressed_at_MouseX_MouseY
var balls = [];
var angle = [0,30,60,90,120,150,180,210,240,270,300,330,360];
function setup() {
createCanvas(400,400);
}
@ulrichzwingli
ulrichzwingli / gist:82ba868ef1aac15596b0a0a3191322d2
Last active October 16, 2017 17:47
Dancing_Falling_Balls_Gravity
var acc, vel, xpos, ypos;
var balls= [];
function setup() {
createCanvas(400, 400);
//for(i=0;i<10;i++){
// balls[i] = new Balls;
}
@ulrichzwingli
ulrichzwingli / gist:c578c9e4af0a2e5f07167ba7840921c4
Created November 7, 2017 18:41
Arduino Code for getting data from 5 piezo sensors
// Arduino code for getting data from 5 piezo sensors
void setup()
{
Serial.begin(9600);
//pinMode(ledPin, OUTPUT);
}
void loop()
{
@ulrichzwingli
ulrichzwingli / gist:2560272c3c24fbfab779d6e3dbef677d
Created November 7, 2017 18:49
Project Chime p5 sketch for sound and visualization
var serial; // variable to hold an instance of the serialport library
var portName = '/dev/cu.usbmodem1411'; // fill in your serial port name here
var inData;
var values;
var j;
//var mappedValue;
var counter1=0;
var counter2=0;
var counter3=0;
var counter4=0;