Go Down

Topic: Video installation with sensor (Read 6 times) previous topic - next topic



I'd like to run a film from a hard drive using a sensor so that the film starts playing when the viewer enters. I want the first frame to be projected as a still image until someone walks in, causing the video to begin playing. Afterwards, I want the film to return to the first frame, ready to play again when someone else enters. It'll be a really short film, about 30 seconds. I have coded for the sensor to control a digital out. How do I go about controlling a video file on a computer, using the arduino? Do I need any special equipment or software? No idea where to start looking. If someone could point me in the right direction, it'd be a big help.



I think that you may need to use Maxmsp for that


You need maxduino and using  jitter max mps with jit.qt movie and also use message commad for go frame $1 (see help for jit qt.movie on max msp)


You could also use a language called Processing, this has the advantage over the other suggestions of being free.


Hi guys. I have since got something to run in Processing, with the film split into stills at 25fps. Both Processing and Arduino sketches run fine with a push button, but I'm having trouble adapting the code to get Processing to read the PING as a switch. I want arduino to trigger processing when the distance is less than 33 inches. Have been on this for days. Any ideas where I'm going wrong? I know it's quite an old post, so will repost if I don't hear back.

Thanks for your help,


Code adapted from: http://www.arduino.cc/en/Tutorial/Ping

// this constant won't change.  It's the pin number
// of the sensor's output:
const int pingPin = 4;

void setup() {
  pinMode(pingPin, INPUT);

void loop()
  // establish variables for duration of the ping,
  // and the distance result in inches and centimeters:
  long duration, inches;

  // The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
  // Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
  pinMode(pingPin, OUTPUT);
  digitalWrite(pingPin, LOW);
  digitalWrite(pingPin, HIGH);
  digitalWrite(pingPin, LOW);

  // The same pin is used to read the signal from the PING))): a HIGH
  // pulse whose duration is the time (in microseconds) from the sending
  // of the ping to the reception of its echo off of an object.
  pinMode(pingPin, INPUT);
  duration = pulseIn(pingPin, HIGH);

// Serial.println(duration); // Print value to serial monitor
  // If there is a an object less than 33 inches from the sensor send 1 to
  // processing, otherwise send 0. (Number of microseconds divided by 74
  // gives ms per inch. Half this value gives the distance of the object)
  if (duration / 74 / 2 < 32)
  Serial.print(1, BYTE);
  } else {
  Serial.print(0, BYTE);

Go Up