Skip to content

Instantly share code, notes, and snippets.

View Frankchai's full-sized avatar

Frank Frankchai

  • Canada
View GitHub Profile
@Frankchai
Frankchai / gist:13c219141b0c6f363937
Created November 13, 2014 01:42
Blinkin Jellyfish_arduino code
#include <RGBLED.h>
RGBLED myled = RGBLED(9,10,11);
int s0=3,s1=4,s2=5,s3=6;
int out=2;
byte flag=0;
byte counter=0;
int countR=0,countG=0,countB=0;
void setup()
@Frankchai
Frankchai / gist:671ca17c6e228f885add
Created November 13, 2014 01:37
Blinking Jellyfish_procssing code
import processing.serial.*;
int yspacing = 16; // How far apart should each horizontal location be spaced
int h; // Width of entire wave
Serial myPort;
float theta = 0.0; // Start angle at 0
float amplitude = 0; // Height of wave
float period = 500.0; // How many pixels before the wave repeats
float dy; // Value for incrementing X, a function of period and xspacing
float[] xvalues; // Using an array to store height values for the wave
@Frankchai
Frankchai / gist:7423313833f6e907f061
Last active August 29, 2015 14:07
processing_code
import processing.serial.*;
import ddf.minim.*;
Serial myPort;
char val;
int appear;
PImage spaceship;
PImage alien;
float centerX;
float centerY;
const int pingPin = 7;
long duration;
long cm;
char trigger;
void setup() {
Serial.begin(9600);
trigger = '2';
}