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 #205 background imageLoading...
Page #205 background image
Emailing Directly from an Arduino
To send an email from the Arduino, well basically implement the
telnet
session
from the previous chapter. Instead of hardwiring the emails attributes into
the networking code, well create create something more advanced.
We start with an
Email
class:
Ethernet/Email/email.h
#ifndef __EMAIL__H_
#define __EMAIL__H_
class Email {
String _from, _to, _subject, _body;
public:
Email(
const String& from,
const String& to,
const String& subject,
const String& body
) : _from(from), _to(to), _subject(subject), _body(body) {}
const String& getFrom() const { return _from; }
const String& getTo() const { return _to; }
const String& getSubject() const { return _subject; }
const String& getBody() const { return _body; }
};
#endif
This class encapsulates an emails four most important attributesthe email
addresses of the sender and the recipient, a subject, and a message body.
We store all attributes as
String
objects.
Wait a minutea
String
class? Yes! The Arduino IDE comes with a full-blown
string class.
4
It doesnt have as many features as the C++ or Java string
classes, but its still way better than messing around with
char
pointers. Youll
see how to use it in a few paragraphs.
The rest of our
Email
class is pretty straightforward. In the constructor, we
initialize all instance variables, and we have methods for getting every single
attribute. We now need an
SmtpService
class for sending
Email
objects:
4.
http://arduino.cc/en/Reference/StringObject
report erratum discuss
Emailing Directly from an Arduino 189
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