As computing becomes more ubiquitous in our objects, designers need to be more aware of how to design meaningful interactions into electronically enhanced objects. At the University of Washington, a class of junior Interaction Design majors is exploring this question. These pages chronicle their efforts.

Tuesday, May 14, 2013

MotionSensingCameraTriggeringProjectExtraordinaire

The final area of confusion for the success of our Motion-Sensing-Camera-Triggering Project was our ability to mimic an infrared remote control with an IR LED, our Arduino and Amy's Nikon D5100. The internet was helpful-ish (thanks to http://sebastian.setz.name/arduino/my-libraries/multi-camera-ir-control/ andhttp://www.bigmike.it/ircontrol/download.html). We ended up having the bits and pieces of code in our hands but not knowing what to do with them, or how to solve the errors on the Arduino program. Thankfully, and timely phone call with an electrical engineering uncle (Thank you, Andrew Hood!) helped add the appropriate "int"s and ";"s.

The following code was somewhat anticlimactic in that you can't see anything. The nature of the remote controls, and infrared lights, is that the sequence is fast and invisible to the naked eye. Unfortunately we still need to purchase an IR LED, so we weren't able to perform the ultimate test: can we actually take a picture with this bugger? In the end, we elongated the lengths of the light flashes, and plopped a regular old LED in our hardware, and were rewarded with a happy little flicker. More on wether we can actually take pictures with it later.

The Code:
  unsigned long start = micros();
  while(micros()-start<=time){
  }
}
void high(unsigned int time, int freq, int pinLED){
  int pause = (1000/freq/2)-4;
  unsigned long start = micros();
  while(micros()-start<=time){
    digitalWrite(pinLED,HIGH);
    delayMicroseconds(pause);
    digitalWrite(pinLED,LOW);
    delayMicroseconds(pause);
}
void setup(){
}
void loop(){
  int _freq = 40;
   int _pin = 9;
  high(2000,_freq,_pin);
  wait(27830);
  high(390,_freq,_pin);
  wait(1580);
  high(410,_freq,_pin);
  wait(3580);
  high(400,_freq,_pin);
  delay(5000);
}
void wait(unsigned int time){
  }

No comments:

Post a Comment