Hardware Reference
In-Depth Information
Objective complete - mini debriefing
We discussed a tool that can annoy a person to remain physically acive.
Setting up an e-mail feed parser
to refill a prescription as well as
remind the user about an upcoming
doctor's appointment
In this task, we will discuss seing up an LED to alert a person about an incoming e-mail to
reill a prescripion or when there is an upcoming doctor's appointment.
Just in case you skipped through Project 6 , Raspberry Pi as a Personal Assistant , the python-
feedparser tool and the python-gdata tool have to be installed:
sudo apt-get install python-feedparser
sudo apt-get install python-gdata
This task is similar to the e-mail noiier we set up in Project 5 , Internet of
Things Example - An E-mail Alert Water Fountain . We will just discuss a
minor modiicaion to blink an LED when there is an e-mail in the inbox to
reill a prescripion.
Engage thrusters
1. We will get started by checking for any new incoming e-mails:
email = feedparser.parse(proto+username+":"+password+"@"+server+pa
th)
2. Let's assume the prescripion reill reminder e-mail subject is called Walgreens .
We will iteraively check through each entry and trigger an LED alert:
for mail in email.entries:
if mail.title == "Walgreens":
async_task = AsyncTask()
async_task.add_callback()
thread = Thread(target=async_task.run, args=())
thread.start()
An asynchronous task can be triggered to blink an LED until the alert is
acknowledged by pressing a button. The circuitry is similar to the one
discussed in the previous task.
 
Search WWH ::




Custom Search