Skip to content

Instantly share code, notes, and snippets.

View joselynNeon's full-sized avatar

joselynNeon joselynNeon

View GitHub Profile
@joselynNeon
joselynNeon / testapp.cpp
Created October 29, 2014 02:49
sound_mesh
#include "testApp.h"
//--------------------------------------------------------------
ofMesh testApp::pixelManipulate(ofImage imageA, ofMesh meshA, float intensityThreshold, float sketchDepth){
imageA.resize(200, 200);
//create mesh with points as the primitive
//meshA.setMode(OF_PRIMITIVE_POINTS);
@joselynNeon
joselynNeon / double_square_helix
Created October 29, 2014 02:27
double_square_helix
Planet p, p2, c, c2, d, d2, g, g2, e, e2;
void setup(){
size(1024, 768, P3D);
// have to do all the openGL stuff on the main thread
e = new Planet(50, 150, PI/20, -250);
e2 = new Planet(50, -150, PI/20, -250);
// Joselyn McDonald w/ help from Processing examples
//----arduino stuff---//
import processing.serial.*;
import cc.arduino.*;
Arduino arduino;
//hooking up the arduino - attach one outer leg to 5v; one outer leg to ground; and one to your Analog IN pins//
int pot1 = 2; // potentiometer 1 is attached to pin A2
@joselynNeon
joselynNeon / gist:8d4ecf84f9acee042240
Created October 1, 2014 21:30
Capsense_LED_Output
//Simple Soft Circuits/Capsense Connection via Spacebrew toolkit
//by Joselyn McDonald and Nicole Messier
//first step: run StandardFirmata sketch in the Arduino IDE
//StandardFirmata sketch if dound under file>examples>firmata>StandardFirmata
//move to Processing for the remainder of this project
//Firmata makes processing now behave like the Arduino IDE
//import firmata library
//Sketch>>Import Library>>Arduino(Firmata)
@joselynNeon
joselynNeon / gist:8c9fba5783a2daa9b21d
Created October 1, 2014 18:27
Capsense for Processing - Connecting Via Serial
//Simple Soft Circuits/Capsense Connection via Spacebrew toolkit
//by Joselyn McDonald and Nicole Messier
//This is Part B of input - You should have already run the Arduino Serial and CapSense Sketch - Soft_Circuits_Capsense_Input_Arduino_Part_A -
//You will need to download Spacebrew and put the spacebrew library in the libraries folder
import spacebrew.*;
//import the Serial library so can read from arudino input via serial communication
import processing.serial.*;
@joselynNeon
joselynNeon / gist:9adb169dad182540dda9
Created October 1, 2014 18:16
Arduino Capsense Code
//import the capSense Library
#include <CapacitiveSensor.h>
//these are the capsense inputs 2 is the common send the second number is the
//other digital input the sensor is attached to
CapacitiveSensor cs_2_3 = CapacitiveSensor(2,3);
void setup() {
//Begin Serial Communication with a baud rate of 9600
@joselynNeon
joselynNeon / spacebrew_frequency_modulation
Created April 27, 2014 15:31
spacebrew_frequency_modulation
/* frequencyModulation
<p>
A simple example for doing FM (frequency modulation) using two Oscils.
<p>
For more information about Minim and additional features,
visit http://code.compartmental.net/minim/
<p>
Author: Damien Di Fede
*/
import spacebrew.*;
import processing.serial.*;
String server = "sandbox.spacebrew.cc";
String name = "PhotoCell_Publisher_" + floor(random(1000));
String description = "This is an example client which publishes the value of a photocell connected to an Arduino ";
int bright = 0; // the value of the phtocell we weill send over spacebrew
Spacebrew spacebrewConnection; // Spacebrew connection object
void setup() {
// open serial port
Serial.begin(9600);
}
void loop() {
// read and send the value of analog sensor
long raw_val = analogRead(A0);
// use to adjust the range, if necessary