EasyManuals Logo

Arduino uno User Manual

Arduino uno
311 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #213 background imageLoading...
Page #213 background image
Bringing It All Together
With our
PassiveInfraredSensor
and
SmtpService
classes, its a piece of cake to build
a burglar alarm with email notifications. Connect the PIR sensor to the Eth-
ernet shield, as shown in the following figure.
Then enter the following code in your Arduino IDE:
Ethernet/BurglarAlarm/burglar_alarm.h
#ifndef __BURGLAR_ALARM_H__
Line 1
#define __BURGLAR_ALARM_H__
-
#include "pir_sensor.h"
-
#include "smtp_service.h"
-
5
class BurglarAlarm {
-
PassiveInfraredSensor _pir_sensor;
-
SmtpService _smtp_service;
-
void send_alarm() {
-
Email email(
10
"arduino@example.com",
-
"info@example.net",
-
"Intruder Alert!",
-
"Someone's moving in your living room!"
-
);
15
_smtp_service.send_email(email);
-
}
-
-
public:
-
BurglarAlarm(
20
const PassiveInfraredSensor& pir_sensor,
-
const SmtpService& smtp_service) :
-
_pir_sensor(pir_sensor),
-
_smtp_service(smtp_service)
-
{
25
}
-
-
-
report erratum discuss
Bringing It All Together 197
www.it-ebooks.info

Table of Contents

Other manuals for Arduino uno

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Arduino uno and is the answer not in the manual?

Arduino uno Specifications

General IconGeneral
Form factorArduino
CertificationRoHS, FC, CE
Processor model-
Processor frequency- MHz
Microcontroller modelATmega328
Microcontroller frequency16 MHz
DC input voltage7-12 V
Operating voltage5 V
DC current per I/O pin40 mA
Flash memory0.032 MB
Maximum internal memory- GB
SRAM (Static Random Access Memory)2 KB
EEPROM (Electrically Erasable Programmable Read-Only Memory)1 KB
Wi-FiNo
Number of analog I/O pins6
Number of digital I/O pins14
Weight and Dimensions IconWeight and Dimensions
Board dimensions53.4 x 68.6 mm

Related product manuals