Skip to content

Instantly share code, notes, and snippets.

View slambert's full-sized avatar

Steve Lambert slambert

View GitHub Profile
@slambert
slambert / face_replace_2017.pde
Created April 1, 2017 23:08
replaces your face with an image
import gab.opencv.*;
import processing.video.*;
import java.awt.*;
PImage b;
Capture video;
OpenCV opencv;
void setup() {
size(640, 480);
@slambert
slambert / time_demo_v2.pde
Created March 23, 2017 16:00
set a time and see red flash 5 seconds later.
// Time Demo
// set a time and see red flash 5 seconds later.
// v 0.2
// Includes text on screen
// Steve is the best
// It seems he can do anything.
// March 23, 2017
int startTime = 0;
int currentTime = 0;
@slambert
slambert / rotating image example.pde
Created March 23, 2017 15:35
Substitute in your own images.
// from https://processing.org/reference/PImage.html
float rotateA; // how fast imageA rotates
float rotateB; // how fast imageB rotates
PImage photovcr; // A VCR
PImage photoDC; // Dabney Colemen
void setup() {
imageMode(CENTER); // rotate from the center!
@slambert
slambert / Modulo Example w start screen.pde
Created March 11, 2017 14:27
code to create a "start screen" - you can build off this to make multliple screens/stages in a sketch.
// Modulo Example w start screen
// Steve Lambert March 8, 2017
// v0.1
// initializing variables
int interval; // how often changes
int xPos;
int yPos;
int circleW = 50;
@slambert
slambert / Rainbow - Function example Sketch.pde
Last active February 23, 2018 02:27
example from class February 21, 2018
/* Function with Return Sketch */
// VARIABLES
color red = color(231, 29, 36);
color orange = color(255, 113, 31);
color yellow = color(255, 255, 31);
color green = color(0, 160, 31);
color blue = color(0, 129, 255);
color purple = color(127, 0, 255);
void setup() {
//fullScreen();
size(600, 600);
strokeWeight(5);
stroke(255,0,0);
}
void draw() {
@slambert
slambert / switch sketch.pde
Created February 9, 2017 14:18
example of how to use a mouse click to throw a switch using a boolean variable
/* Switch Sketch
Steve Lambert
*/
// declare boolean variable
boolean switchstatus = false;
int circleWidth = 30;
void setup(){
@slambert
slambert / Color Palette example.pde
Last active February 9, 2017 14:12
One way you can use color palettes in a sketch
/*
Color Palette example sketch
Steve Lambert 2017-02-09
*/
// My Pallette
// Taken from https://color.adobe.com/Aspirin-C-color-theme-251864/edit/?copy=true
color darkBlue = color(34,83,120);
color medBlue = color(22,149,163);
@slambert
slambert / arduino-lie-detector-thing.ino
Created December 7, 2016 17:18
this doesn't work. Felicity, update it when you fix it!
import cc.arduino.*;
import org.firmata.*;
import processing.serial.*;
Arduino arduino;
/*
Random Line Drawer v03
Makes line that climbs and falls using a GSR sensor
@slambert
slambert / face_replace_2016.pde
Created November 29, 2016 21:57
You need to install the OpenCV library and Video library. Then put an image in the data folder and update line 14.
import gab.opencv.*;
import processing.video.*;
import java.awt.*;
PImage b;
Capture video;
OpenCV opencv;
void setup() {
size(640, 480);