Teile:
Arduino Uno
Adafruit WaveShield
Parallax PIR
Einige Draht
Ein Projekt Fall
Gewusst wie: downloaden "Nie gonna give you up", verdeckte die Datei gemäß Ladyadas Anweisungen für die Welle Shield (muss sein. WAV auf 16bit und 22 Hertz), Connect der PIR-Sensor, 5volts, Boden und digitale Pin6 auf der Welle Shield. Auf dem Arduino hochladen Sie bereitgestellten Code, setzen Sie Wave Schild auf, werfen Sie es in einem diskreten Fall. Voila fertig. Nun gehe Astley am Ort.
Eine andere RickRoller gibt, nutzt dieses einen Timer und weitere elektronische Spielereien. Meins ist lächerlich einfach und macht Spaß für Herumspielen mit zufälligen Fremden. Ich habe Rickrolled, die einige zufällige Menschen so weit, am meisten nicht es fast so lustig finden wie ich.
Yay-Video. Tut mir leid aber alles ich habe jetzt Laptop Webcam eingebaut ist. Tut das beste, was ich kann mit dem was ich habe. Setzen Sie ein Laser-Cutter in meinen Händen und ich mache etwas Epos. Tipp, Tipp.
Ich rollte Rick-meine Freundin ein halbes Dutzend Mal heute Abend in unserer kleinen Residence Inn-Suite. Meine Freude war haltlos. Die Überraschung ist alles. Tut mir leid ich nicht ihre Freude am sein pranked erfassen. Es ist schwer, video, die wenigen Momente zu erfassen, wenn jemand von meinen Astley fallen zu Fuß wird, stundenlang laufen lassen. Aber ich versichere Ihnen, es lohnt sich die Absteckung irgendwohin.
CODE: Guthaben wo seine fällig, einige für Kristian Gohlke, LadyAda auch bekommt mad Props für sein so erstaunlich! Thx Limor. Ich konnte nicht begonnen haben, ohne Ihre Produkte, ehrfürchtig Code und Inspiration Haltung dazu.
/* * ////////////////////////////////////////////////// * //making sense of the Parallax PIR sensor's output * ////////////////////////////////////////////////// * * Switches a LED according to the state of the sensors output pin. * Determines the beginning and end of continuous motion sequences. * * Kristian Gohlke / krigo(_)web.de / http://filformat.net * 3. September 2006 * * kr1 (cleft) 2006 * released under a creative commons "Attribution-NonCommercial-ShareAlike 2.0" license * http://creativecommons.org/licenses/by-nc-sa/2.0/de/ * * * The Parallax PIR Sensor is an easy to use digital infrared motion sensor module. * (http://www.parallax.com/detail.asp?product_id=555-28027) * * The sensor´s output pin goes to HIGH if motion is present. * However, even if motion is present it goes to LOW from time to time, * which might give the impression no motion is present. * This program deals with this issue by ignoring LOW-phases shorter than a given time, * assuming continuous motion is present during these phases. * *////////////////////////////////VARS #include #include #include "util.h" #include "wave.h" AF_Wave card; File f; Wavefile wave; int calibrationTime = 30; //the time we give the sensor to calibrate itself (10-60 secs according to the datasheet)longunsignedint lowIn; //the time when the sensor outputs a low impulselongunsignedint pause = 5000; //the amount of milliseconds the sensor has to be low before we assume all motion has stoppedboolean lockLow = true; boolean takeLowTime; int pirPin = 6; //the digital pin connected to the PIR sensor's outputint ledPin = 13; ///////////////////////////////SETUPvoidsetup(){ Serial.begin(9600); pinMode(pirPin, INPUT); pinMode(ledPin, OUTPUT); pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); pinMode(5, OUTPUT); digitalWrite(pirPin, LOW); //give the sensor some time to calibrate Serial.print("calibrating sensor "); for(int i = 0; i < calibrationTime; i++){ Serial.print("."); delay(1000); } Serial.println(" done"); Serial.println("SENSOR ACTIVE"); delay(50); if (!card.init_card()) { return; } if (!card.open_partition()) { return; } if (!card.open_filesys()) { return; } if (!card.open_rootdir()) { return; } } //////////////////////////////LOOPvoidloop(){ if(digitalRead(pirPin) == HIGH){ digitalWrite(ledPin, HIGH); //the led visualizes the sensors output pin state if(lockLow){ lockLow = false; //make sure we wait for a transition to LOW before any further output is made Serial.println("---"); Serial.print("motion detected at "); Serial.print(millis()/1000); Serial.println(" sec"); delay(50); } takeLowTime = true; } if(digitalRead(pirPin) == LOW){ digitalWrite(ledPin, LOW); //the led visualizes the sensors output pin state 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(!lockLow && millis() - lowIn > pause){ //if the sensor is low for more than the given pause, we assume that no more motion is going to happen lockLow = true; //makes sure this block of code is only executed again after a new motion sequence has been detected Serial.print("motion ended at "); //output Serial.print((millis() - pause)/1000); Serial.println(" sec"); delay(50); } switch(digitalRead(pirPin) == HIGH){ case 1: playcomplete("01NEVE~1.WAV"); } }} void playcomplete(char *name) { playfile(name); while (wave.isplaying); card.close_file(f); } void playfile(char *name) { // stop any file already playing if (wave.isplaying) { wave.stop(); card.close_file(f); } f = card.open_file(name); if (f && wave.create(f)) { wave.play(); } }