• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 5 pages
Essay

Unit 19 Assignment 2 Example 2 (ACHIEVED DDM OVERALL)

Document preview thumbnail
Preview 2 out of 5 pages

How I answered the assignment for Unit 19 Information Technology.

Content preview

Raspberry Pi Motion Detector Annotated Diagram

, Raspberry Pi Motion Detector Code
from gpiozero import MotionSensor
from picamera import PiCamera
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
import datetime
import time
import smtplib
#Email Addresses
FromAddress =

ToAddress =
#Finds Motion Sensor and Camera
PIRSensor = MotionSensor(4)
camera = PiCamera()
#Exit While loop
Tripped = True
#Wait Five Seconds
time.sleep(5)
while Tripped:
if PIRSensor.motion_detected:
print("Motion Detected")
#Take a Picture
Tripped = False
TimeCaptured = “/home/pi/Desktop” + datetime.datetime.now().strftime(“%Y-%m-
%d%H:%M:%S”) + “.png”
camera.rotation = 180
camera.capture(TimeCaptured)
print("Image Taken")
#Create the Message
msg = MIMEMultipart()
msg[ “Subject”] = “Intruder”
msg[“From”] = FromAddress
msg[“To”] = ToAddress

#Attach the File
File = open(TimeCaptured, “rb”)
img = MIMEImage(File.read())
File.close()
msg.attach(img)
# Log in Details for FromAddress
username=“”
password=“1999hot”
# The Email Sends from a Microsoft Account
server = smtplib.SMTP(“smtp-mail.outlook.com:587”)

Document information

Study Level
Subject
Uploaded on
September 13, 2022
Number of pages
5
Written in
2020/2021
Type
Essay
Professor(s)
Unknown
Grade
B
$16.66

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Scrumlin
2.5
(22)
Sold
333
Followers
172
Items
182
Last sold
2 weeks ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions