This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************* | |
* Public Constants | |
*************************************************/ | |
#define NOTE_B0 31 | |
#define NOTE_C1 33 | |
#define NOTE_CS1 35 | |
#define NOTE_D1 37 | |
#define NOTE_DS1 39 | |
#define NOTE_E1 41 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
WiFi Alarm | |
by Nahla Ibrahim & Amber Nomani | |
Network Everything Spring 2016 | |
Data is logged at: https://thingspeak.com/channels/98384 | |
Base code adapted from WiFi 101 ThingSpeak Data Uploader http://arduino.cc/en/Tutorial/WiFi101ThingSpeakDataUploader | |
*/ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Car { | |
//color c; | |
float xPos; | |
float yPos; | |
float ySpeed; | |
PImage squir; | |
// The Constructor is defined with arguments. | |
Car() { | |
xPos = width/2; | |
yPos = 40; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//code for looping background from: https://forum.processing.org/two/discussion/12084/looping-background-image | |
//code for car is from Scott F. | |
import processing.serial.*; // import the Processing serial library | |
Serial myPort; // instance of the setial object | |
float moveX, speed; //variables for the 'player' | |
float inByte; // variable for the car speed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// code for the RGB LED is adapted from sparkfun website | |
//L for left and R for right | |
int ledPinL = 13; | |
int switchPinL = 2; | |
int ledPinR = 12; | |
int switchPinR = 7; | |
int switchStateL; | |
int switchStateR; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var raindrops = new Array(100); | |
var raindrops2 = new Array(400); | |
var snow = new Array(20); | |
var clouds = new Array(30); | |
var cw; | |
var stop = 90; | |
var n = 0; m = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Snowflake(x1, y1) { | |
//this.x = x1; | |
//this.y = y1; | |
this.h = random(30); | |
//this.speed = random(1,3); | |
this.pos = createVector(x1, y1); // for position | |
this.vel = createVector(0, 0); // for velocity | |
this.acc = createVector(0, 0) | |
//this.r = 16; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Rain(){ | |
this.pos = createVector (random(799), random(799)); | |
this.height = random (50,130); | |
this.vel = createVector(0,random(1,4)) | |
this.acc = createVector (0, 1) | |
this.applyForce=function(force){ | |
this.acc.add(force); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Cloud(x1, y1){ | |
this.pos = createVector (x1, y1); | |
this.vel = createVector(0,0); | |
this.scale= random(0.2, 1.2); | |
//this.acc=createVector(0,0); | |
this.applyForce = function(force){ | |
this.vel.add(force); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function colorWheel() { | |
this.move = function(stop, bp) { | |
colorMode(HSB, 360, 100, 100); | |
angleMode(DEGREES); | |
for (i = 90; i < stop; i++) { | |
fill(i%360, 100, 100); | |
stroke(i%360, 100, 100); | |
arc(700, 90, 130, 130, i, i+1) |
NewerOlder