Hello everybody,I'd like to control a video via PIR sensor.I've just bought an Arduino 2009.I have to show a video on a projector (PC or MAC + Projector) and i want to start playing the video when this sensor is excited.Is it possible? Are there any softwares?Thank you very much.

Thank you,I'm trying to read serial data using that functions, but the PIR sensor sends "00000000000001111111" series when there is not movement.When there are motions it sends "00000000000".Processing gets "94848494949494949494848484848484848484848484848484848494949" series.

Then you should use every trick in the book to help you visualize what your code is doing. Put each { and } on its own line. Use Tools + Auto Format to properly line up the braces and indent all code in between the braces.

Quote

I thought that it sends 1 when there is not movement, so i put that in the loop() function.

Where do you turn the LED off? Why don't you store the value read from the PIR pin the first time, then print that. You are currently reading the pin again. The second reading may not get the same result as the first reading.

Clearly, it is time for you to get very, very specific. What sensor are you talking about?

PIR sensors generally have two states - detecting movement or not detecting movement. In general, they do not need to be "calibrated". If all you are doing is waiting for the sensor to get ready, why don't the comments reflect that? 5 seconds is a long time to wait for a PIR sensor to get ready.

if(digitalRead(pirPin) == HIGH){ digitalWrite(ledPin, HIGH); //the led visualizes the sensors output pin state if(lockLow){ //makes sure we wait for a transition to LOW before any further output is made: lockLow = false;

if(takeLowTime){ lowIn = millis(); //save the time of the transition from high to LOW takeLowTime = false; //make sure this is only done at the start of a LOW phase } //if the sensor is low for more than the given pause, //we assume that no more motion is going to happen if(!lockLow && millis() - lowIn > pause){

//makes sure this block of code is only executed again after //a new motion sequence has been detected