The excellent Rob Ray and I have started a podcast called Opposable Thumbs. I used to organize art events with Rob in Chicago some years ago, and I’ve been itching to work with him again ever since he escaped to LA.
OT is a biweekly creative exercise where Rob and I invite a guest to set some sort of design challenge. Next, the three of us each make something based on that prompt, then Skype in to talk about our successes and failures. The first episode is out now! Here’s a preview of my project:
In this episode I create a diegetic prototype that recruits material “flaws” (such as the knot above) to act as touch sensors. The paperclip or other wire is embedded in the wood and attached to two pins on the Arduino. Add a 1M resistor or greater and use the source code below. Right now we’re just blinking an LED, but that’s how all great things start… Please download, remix, and send me photos or video of your implementation!
/* * Taylor Hokanson * Based on Paul Badger's CapitiveSense Library Demo Sketch * http://playground.arduino.cc/Main/CapacitiveSensor?from=Main.CapSense * * Attach a 1M or higher resistor between pins 4 & 2 * Attach a paperclip or other wire to the leg of the resistor at pin 2 * See onboard LED to test responsivity */ #include <CapacitiveSensor.h> int LEDPin = 13; boolean lightOn = false; int touchCounter = 0; long previousReading; int sensitivity = 25; CapacitiveSensor cs_4_2 = CapacitiveSensor(4,2); void setup() { pinMode(LEDPin, OUTPUT); digitalWrite(LEDPin, LOW); // turn off autocalibrate on channel 1 - just as an example cs_4_2.set_CS_AutocaL_Millis(0xFFFFFFFF); Serial.begin(9600); } void loop() { long start = millis(); long currentReading = cs_4_2.capacitiveSensor(30); if(currentReading > sensitivity && previousReading > sensitivity && lightOn == false){ touchCounter++; if(touchCounter >= 5){ digitalWrite(LEDPin, HIGH); lightOn = true; touchCounter = 0; delay(500); } } if(currentReading > sensitivity && previousReading > sensitivity && lightOn == true){ touchCounter++; if(touchCounter >= 5){ digitalWrite(LEDPin, LOW); lightOn = false; touchCounter = 0; delay(500); } } Serial.println(currentReading); previousReading = currentReading; delay(30); }