Skip to content

Instantly share code, notes, and snippets.

View soilTales.io
/* Ella Dagan, Olivia Cueva, Vinyata Pany
Feb 20, 2017
Music Player, Tangible Interaction Workshop
To control p5.js music player sketch created by Tom Igoe
https://github.com/tigoe/p5js_examples/tree/master/musicPlayer
Sensors
- Toggle Switch
- Momentary Push Button
View bamboo.pde
class Bamboo {
float x, y, t, h, grow, growSpeed, opacity;
color col;
float curT, curH;
ArrayList<Branch> branches;
float branchDirection;
Bamboo(float _x) {
this.x = _x;
View dj_slider.js
var song1;
var song2;
var song3;
var speedSlider1;
var volumeSlider1;
var speedSlider2;
View alarm_mat_midterm.js
// Declare a "SerialPort" object
var serial;
var song;
// Variable for size
var switchState = 0;
function preload() {
song = loadSound('assets/sade.mp3');
}
View triangle_sketch.js
var x = 50;
function setup() {
createCanvas(windowWidth, windowHeight);
}
function draw() {
background('Lavender');
fill(50,20,225,130);
triangle(30, 75, 58, 20, 86, 75);
View jamika.js
var img; // create an image variable
var lineX = 124; // set X coordinate for lazer eyes
var lineY = 136; // set Y coordinate for lazer eyes
function preload (){
img = loadImage ("images/jamika.png");
}
function setup() {
View ICM_assignment2.js
var triangleX = 500;
function setup() {
createCanvas(windowWidth, windowHeight);
background(200);
}
function draw() {
//triangle1 will be controlled by movement of mouse
fill(200, 0, 255, 20);
triangle (50, 25, mouseX, mouseY, 200, 200);