Skip to content

Instantly share code, notes, and snippets.

// Libraries
//same as the other code expept instead of
//using buttons it uses arrow keys (wasd for player 1 and rightleftupdown for layer two) on the coputer keyboard
//import processing.serial.*;
//import cc.arduino.*;
//Calling Arduino Ports
//Arduino arduino;
Code provided by Tinkernut
http://www.tinkernut.com/2014/03/arduino-motion-detecting-squirt-gun/
We didnt change anything in this code
const int pirPower = 13;
const int pirIn = 12;
int motorPin1 = 3;
@SLOLNE
SLOLNE / Silver Spray Paint on Canvas
Created March 2, 2016 19:23
a simple processing particle sketch to accompany our hardware. Its not in conversation with the hardware, but ideally would be so that when the person walks by the sensor they make a physical and digital painting simultaneously.
This code is from the example section on Prosessing.org
It is authored by: Daniel Shiffman
I just changed the background colour from balck to white and made the window a little larger.
ArrayList<ParticleSystem> systems;
void setup() {
size(900, 660);
systems = new ArrayList<ParticleSystem>();
}
void setup (){
size(600, 600);//size of canvas
background(120, 0, 11);//bachground colour HSB
}
void draw() {//opens draw loop which runs on loop
noStroke();
void setup()
got this from one of the examples, likes the thumbnail.
I added more points
{
size(600, 600); //size of canvas
background(192, 64, 10);//background colour= orange
//Camille Kauffman
//excercise 5-5 from Getting started with Arduino
const int SENSOR = 0; // select the input pin for the // sensor resistor
int val = 0; // variable to store the value coming // from the sensor
void setup() {
Serial.begin(9600); // open the serial port to send // data back to the computer at
}
void loop() {
// 9600 bits per second
//Camille Kauffman
//excercise 5-4 from Getting Started with Arduino
const int LED = 9; // the pin for the LED
int val = 0; // variable used to store the value // coming from the sensor
void setup() {
pinMode(LED, OUTPUT); // LED is as an OUTPUT // Note: Analogue pins are
}
//Camille Kauffman
//excercise 5-2 from Getting started with Arduino
const int LED = 9; // the pin for the LED
const int BUTTON = 7; // input pin of the pushbutton
int val = 0; // stores the state of the input pin int old_val = 0; // stores the previous value of "val"
int state = 0; // 0 = LED off while 1 = LED on
int brightness = 128; // Stores the brightness value unsigned long startTime = 0; // when did we begin pressing?
@SLOLNE
SLOLNE / sketch_jan15g.ino
Last active January 19, 2016 19:52
Button Pressed (on and off)
// BLINKING LED on/off
//Camille Kauffman
//excercise 4-5 from Getting Started with Arduino
const int LED = 12; //the pin for the LED
const int BUTTON = 7;//the input pin whrtr the pushbutton is connected
int val = 0;//val will be used to store the state of the input pin
@SLOLNE
SLOLNE / buttonpressedsketch_jan15e
Created January 19, 2016 19:48
Button Pressed
// Turn on LED while the button is pressed
//Camille Kauffman
//excercise 4-2 from Getting Started with Arduino
const int LED = 13; //the pin for the light
const int BUTTON = 7;//the input pin hwere the pushbutton is connected
int val = 0; //val will be used to store the state of the input pin