Skip to content

Instantly share code, notes, and snippets.

function setup() {
createCanvas(1024, 700);
background(0, 128, 255);
}
function draw() {
//gray fill
fill(144);
var you = "Can you count to 4 million?"
var syria = "Since 2011, 3.8 million Syrians have lost their homes. Nearly 200,000 have lost their lives."
var count = 1;
var countX = 0;
var countY = 0;
function setup() {
createCanvas(800,800)
background(255);
}
var trump = {
x:0,
y:0,
w:100,
h:138,
speedx:8,
speedy:8,
};
@lisajamhoury
lisajamhoury / gist:57a88991a76089ffc8a7
Created September 23, 2015 01:48
Arduino Analog Input Digital Output
//this is basic code for variable/analog resistor
int ledPin = 2;
int sensorPin = A0;
int sensorValue = 0;
void setup() {
// put your setup code here, to run once:
pinMode(ledPin, OUTPUT);
var trump = {
x:0,
y:0,
w:100,
h:138,
speedx:0,
speedy:0,
};
var jeb = {
/* I started with:
Controlling a servo position using a potentiometer (variable resistor)
by Michal Rinott <http://people.interaction-ivrea.it/m.rinott>
modified on 8 Nov 2013
by Scott Fitzgerald
http://www.arduino.cc/en/Tutorial/Knob
*/
#include <Servo.h>
@lisajamhoury
lisajamhoury / answers.json
Created October 20, 2015 04:27
p5 code for magic 8 ball
{
"answers" : [
{"type": "positive", "value": "It is certain"},
{"type": "positive", "value": "It is decidedly so"},
{"type": "positive", "value": "Without a doubt"},
{"type": "positive", "value": "Yes definitely"},
{"type": "positive", "value": "You may rely on it"},
{"type": "positive", "value": "As I see it, yes"},
{"type": "positive", "value": "Most likely"},
{"type": "positive", "value": "Outlook good"},
// punctuation serial communication
//int button1 = 0;
void setup() {
// configure the serial connection:
Serial.begin(9600);
while (Serial.available() <= 0) {
Serial.println("hello"); // send a starting message
}
@lisajamhoury
lisajamhoury / arduino.ino
Last active October 21, 2015 23:40
Trumpong Code for PComp Midterm
// punctuation serial communication
void setup() {
// configure the serial connection:
Serial.begin(9600);
while (Serial.available() <= 0) {
Serial.println("hello"); // send a starting message
delay(300); // wait 1/3 second
}
@lisajamhoury
lisajamhoury / receiver_v1.ino
Created November 17, 2015 03:30
Heart Rate to P5 Bezier Prototype 1
//include filter libraries
#include <FilterDerivative.h>
#include <FilterOnePole.h>
#include <Filters.h>
#include <FilterTwoPole.h>
#include <FloatDefine.h>
#include <RunningStatistics.h>
#include <RFM69.h>
#include <SPI.h> // the RFM69 library uses SPI