Skip to content

Instantly share code, notes, and snippets.

Natalie Freed nataliefreed

View GitHub Profile
@nataliefreed
nataliefreed / TinkerableArray.pde
Last active Aug 29, 2015 — forked from anonymous/TinkerableArray.pde
Sketch for experimenting with image arrays in Processing.
View TinkerableArray.pde
int rows = 10;
int columns = 12;
int[] circles = new int[rows*columns];
int index;
int spacing = 50;
int circleSize = 6;
void setup()
{
@nataliefreed
nataliefreed / speedcontrol.ino
Last active Aug 29, 2015
Robotic arm speed control
View speedcontrol.ino
/*
Robotic arm speed control demo
Natalie Freed, Jan 2014
*/
#include <Servo.h>
Servo base, shoulder, elbow, wrist, gripper;
@nataliefreed
nataliefreed / DraggableExample.pde
Last active Aug 29, 2015
Draggable objects and handler example for Processing 2.0 Natalie Freed, March 2014
View DraggableExample.pde
/*
Draggable objects and handler example for Processing 2.0
Natalie Freed, March 2014
*/
DraggableHandler circles;
void setup()
{
size(500, 500);
@nataliefreed
nataliefreed / cp5buttonexample.pde
Created Mar 19, 2014
Adapted from ControlP5 Button Example by by Andreas Schlegel, 2012 from www.sojamo.de/libraries/controlp5
View cp5buttonexample.pde
//Adapted from ControlP5 Button Example by by Andreas Schlegel, 2012
//www.sojamo.de/libraries/controlp5
import controlP5.*; //make sure ControlP5 library is installed for this line to work
ControlP5 cp5;
int myColor = color(255);
void setup() {
size(400,400);
View lilyrgbcount.ino
//count pressed, turn from red to green by Natalie Freed
//April 2014
//with debounce code from David Mellis
int red = 9;
int blue = 10;
int green = 11;
int buttonPin = A5;
@nataliefreed
nataliefreed / RGB_LilyPad_ProtoSnap.ino
Created Apr 4, 2014
RGB Color-Mixing LED example code for LilyPad ProtoSnap
View RGB_LilyPad_ProtoSnap.ino
//RGB Color-Mixing LED
//For LilyPad ProtoSnap
/*************************************
//Change the variables in this section
//Colors are between 0 and 255
//Times are in milliseconds. For eg., 1 second = 1000 milliseconds.
*************************************/
int colors[][3] = { {255, 150, 0}, {100, 0, 200}, {255, 0, 0}};
int times[] = { 5000, 1000, 500 };
int numberOfColors = 3;
@nataliefreed
nataliefreed / StateMachineTimer.pde
Created May 6, 2014
State Machine Stopwatch Example (2 states)
View StateMachineTimer.pde
ArrayList<RectangularButton> buttons = new ArrayList<RectangularButton>();
RectangularButton startButton;
boolean startClicked = false;
String currentState = "STOPPED";
boolean timerRunning = false;
int time = 0;
int timeStarted = millis();
int countInterval = 1000; //timer counts seconds
void setup()
@nataliefreed
nataliefreed / squareling.pde
Last active Aug 29, 2015
Stop Motion Creature
View squareling.pde
SquareCreature squareling;
float tblink, tbounce = 0;
int numSleepyImgs = 4;
PImage happyImg, blinkImg, angryImg, sleepyImg;
PImage[] sleepyImgs = new PImage[numSleepyImgs];
void setup()
{
imageMode(CENTER);
@nataliefreed
nataliefreed / code_generator.pde
Created May 8, 2014
Processing Code Generator / Drawing Tool
View code_generator.pde
import controlP5.*;
ControlP5 cp5;
DraggableHandler circles;
ArrayList<Draggable> shapes;
int toolbarWidth = 75;
PVector toolbarLoc;
int codeMenuWidth = 300;
View register_key_events.pde
//Register key events in Processing 2.0
//Natalie Freed 2014
//References:http://processing.org/reference/javadoc/core/processing/event/KeyEvent.html
//http://forum.processing.org/one/topic/how-to-register-methods-in-processing-2b1.html
//http://wiki.processing.org/w/Register_events (1.0 way)
//circle changes color when 'c' key pressed, changes back when key released
KeyboardyCircle kc = new KeyboardyCircle(0, this);
You can’t perform that action at this time.