This code is NOT to be shared with any who do not possess the Dark Mark. Death Eaters have worked relentlessly on developing this and do not want any worthless muggle-borns or blood traitors laying their filthy little hands on it.

Open Thonny Python IDE from the programing menu and paste the code from file attached

#part 1 of code, motion detector code<br>#!/usr/bin/python<br>import RPi.GPIO as GPIO import time import os</p><p>class detector(object): def __init__(self, sensor): self.callBacks = [] self.sensor = sensor self.currState = False self.prevState = False</p><p> GPIO.setmode(GPIO.BOARD) GPIO.setup(self.sensor, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)</p><p> def read(self): self.prevState = self.currState self.currState = GPIO.input(self.sensor)</p><p> def printState(self): print( "GPIO pin {0} is {1}".format(self.sensor, "HIGH" if self.currState else "LOW"))</p><p> def subscribe(self, callBack): self.callBacks.append(callBack)</p><p> def callBack(self, state): for fn in self.callBacks: fn(state)</p><p> def start(self): try: self.read() self.printState() while True: self.read() if self.currState != self.prevState: self.printState() self.callBack(self.currState) time.sleep(.1)</p><p> except (KeyboardInterrupt, SystemExit): #Since fbi doesn't restore the console correctly when the application is exited we do a little clean up. os.system('stty sane')</p><p>#part 2 of code, photo and video #!/usr/bin/python import subprocess as sp import sys</p><p>video = ["omxplayer", "filename", "-o", "both", "--win", "0 0 1680 1050", "--aspect-mode", "fill", "--no-osd", "--orientation" ,"0","--vol", "-600"] videoFile = "/home/pi/Videos/1680x1050video.mp4" print(videoFile)</p><p>def onMotion(currState): if currState: video[1] = videoFile subVideo = sp.Popen(video) while subVideo.poll() is None: time.sleep(.1)</p><p>def showImage(): os.system("sudo fbi -T 1 -d /dev/fb0 -noverbose -once /home/pi/Pictures/1680x1050picture.jpg")</p><p>showImage() objDetect = detector(7) objDetect.subscribe(onMotion) objDetect.start() os.system("sudo killall -9 fbi")

Save file We saved ours to a folder named genlab and named it Masterpiece.py

Test Code Open terminal and open file.



cd genlab Python Masterpiece.py

*This is how the code actually works.

Our code displays an idle image on a monitor until the motion sensor detects movement and activating a video file and returns to the idle image’s initial still position. We were able to find a open source code used by Dominick Morino in his Possessed Portrait DIY Project, and simplified it for our project’s. We split the portrait code into two sections: the motion sensor commands and then the photo/video commands. For the motion sensor, we imported the initial libraries for Raspberry Pi and the GPIO board. You don’t need to change anything on the first part of sensor code. The second part of the code imports further libraries to allow the video commands to be contingent upon the sensor code in part 1.