Skip to content

Instantly share code, notes, and snippets.

@XiaohanYa
XiaohanYa / inClass_arduino.ino
Created March 3, 2017 02:26
InteractionLab
int valueFromProcessing;
void setup() {
Serial.begin(9600);
pinMode(13, OUTPUT);
}
void loop() {
//Serial.write(100);//serial.write number refers to code while serial print number is number
import processing.serial.*;
Serial myPort;
int valueFromArduino;
void setup() {
size(500, 500);
background(0);
// print(int('a'));// print out=97
//print(char(97));// print out=a
//print(Serial.list());
@XiaohanYa
XiaohanYa / MidtermProject.pde
Created March 3, 2017 02:31
InteractionLab
import ddf.minim.*;
Minim minim;
AudioPlayer groove;
PImage img;
PImage img1;
PImage img2;
PImage img3;
@XiaohanYa
XiaohanYa / FinalProject.pde
Created March 3, 2017 02:37
InteractionLab_SingingBird_InteractiveGame
//co-coding With GuangyuWu
boolean serialMode = true;
boolean debugMode = false;
boolean testMode = false;
boolean xbeeOn = false;
boolean showData = false;
boolean gameEnd = false;
int timeFromEnd = 0;
//int _endFrameCount = 0;
var x;
var y = 1;
var xspeed, yspeed;
var gravity;
var mouseForce;
var randomSize;
var randomColor;
function setup() {
createCanvas(500, 600);
var circles = [];
var gravity;
var mouseForce;
function setup() {
createCanvas(500, 600);
background(0);
for (var i = 0; i < 10; i++) {
var particles = [];
function setup() {
createCanvas(1000, 600);
background(0);
for (var i = 0; i < 80; i++) {
particles.push(new Particle(width / 2, height / 2));
}
}
var planets = [];
var particles = [];
function setup() {
createCanvas(1200, 800);
planets.push(new Planet(-300, random(-200, 200), random(80, 120))); // x,y,radius
planets.push(new Planet(300, random(-200, 200), random(150, 200))); // x,y,radius
var earth;
var moon;
function setup() {
createCanvas(1000, 600);
background(0);
earth = new Earth(0, 0, random(30, 50));
moon = new Moon(100, 100, random(3, 5));
var planets = [];
var particles = [];
function setup() {
createCanvas(1200, 800);
for (var i = 0; i < 7; i++) {
planets.push(new Planet(-500 + 130 * i, -400 + 130 * i, random(80, 120))); // x,y,radius
}