Skip to content

Instantly share code, notes, and snippets.

@arielchuri
arielchuri / QuicksilverKey.XML
Last active December 21, 2015 12:49
XML for KeyRemap4MacBook in or order to use the caps lock key for Quicksilver (or any other launcher really). More info here: http://arielchuri.tumblr.com/post/58814872871/the-quicksilver-key Modified from here: http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/
<?xml version=”1.0”?>
<root>
<item>
<name>F19 to F19</name>
<appendix>(F19 to Hyper (ctrl+shift+cmd+opt) + F19 Only, send F19)</appendix>
<identifier>private.f192f19_escape</identifier>
<autogen>
--KeyOverlaidModifier--
KeyCode::F19,
KeyCode::COMMAND_L,
@arielchuri
arielchuri / Robot1_Draw.pde
Last active December 22, 2015 00:39
Example text from the book "Getting Started with Processing"
// Robot 1: Draw from "Getting Started with Processing"
// by Reas & Fry. O'Reilly / Make 2010
size(720, 480);
smooth();
strokeWeight(2);
background(204);
ellipseMode(RADIUS);
// Neck
@arielchuri
arielchuri / fred01.ino
Last active December 22, 2015 05:58
Increment variable up and down and print it.
//Variables go first
int fred = 0;
int fredDir= 0; //0 means fred is going up. 1 for down
//setup runs once
void setup() {
}
//draw happens over and over
void draw() {
@arielchuri
arielchuri / arlo01.ino
Last active December 22, 2015 06:08
Here a character moves back and forth.
//Variables go first
int arloX = 200;
int arloY = 350;
int fredDir = 0;
int look = 0; // extra credit
//setup runs once
void setup() {
size(400, 400);
}
@arielchuri
arielchuri / EmergingObjects_4_3.ino
Last active December 22, 2015 11:38
Final code for class 4 of Emerging Objects
/*
* EMERGING OBJECTS
* CLASS 4 / PART 3
*
* +-----+
* | +-+ |
* TOUCH | | | |
* SENSOR| +---+
* +-----+
* ARDUINO |
/*
* EMERGING OBJECTS
* CLASS 4 / PART 2
* +-----+
* | +-+ |
* TOUCH | | | |
* SENSOR| +---+
* +-----+
* ARDUINO |
* +-----------+ |
/*
* EMERGING OBJECTS
* CLASS 4 / PART 1
* +-----+
* | +-+ |
* TOUCH | | | |
* SENSOR| +---+
* +-----+
* ARDUINO |
* +-----------+ |
@arielchuri
arielchuri / EmergingObjects_3_1.ino
Created September 6, 2013 17:09
CapSense Test Code
//CapSense Test Code
#include <CapacitiveSensor.h>
CapacitiveSensor cs_4_2 = CapacitiveSensor(4,2); // 10 megohm resistor between pins 4 & 2, pin 2 is sensor pin, add wire, foil
void setup()
{
@arielchuri
arielchuri / EmergingObjects_3_2.ino
Last active December 22, 2015 11:38
Using the CapSense data.
#include <CapacitiveSensor.h>
CapacitiveSensor cs_4_2 = CapacitiveSensor(4,2);
int led = 13;
int led2 = 11;
byte fade;
long timer;
long previousTimer;
int ledState = LOW;
int sensorPin = A0;
int sensorValue = 0;
// Setup the touch sensor.
#include <CapacitiveSensor.h>
CapacitiveSensor cs_4_2 = CapacitiveSensor(4,2);
// Setup the light sensor
int sensorPin = A0;
int sensorValue = 0;
boolean dark = false;
// Set up the LEDs