Arduino and Raspberry Pi Sensor Projects for the Evil Genius 1st Edition Chin instant download
Arduino and Raspberry Pi Sensor Projects for the Evil Genius 1st Edition Chin instant download
https://ebookmeta.com/product/arduino-and-raspberry-pi-sensor-
projects-for-the-evil-genius-1st-edition-chin/
https://ebookmeta.com/product/raspberry-pi-electronics-projects-
for-the-evil-genius-1st-edition-norris/
https://ebookmeta.com/product/beginning-sensor-networks-with-
xbee-raspberry-pi-and-arduino-second-edition-sensing-the-world-
with-python-and-micropython-charles-bell/
https://ebookmeta.com/product/raspberry-pi-projects-for-kids-1st-
edition-daniel-bates/
https://ebookmeta.com/product/swift-apprentice-seventh-edition-
eli-ganim/
A Touch of Wrath Vices Virtues 1st Edition Daphne
Elliot
https://ebookmeta.com/product/a-touch-of-wrath-vices-virtues-1st-
edition-daphne-elliot/
https://ebookmeta.com/product/bonds-of-secrecy-law-spirituality-
and-the-literature-of-concealment-in-early-medieval-england-the-
middle-ages-series-benjamin-a-saltzman/
https://ebookmeta.com/product/a-rainy-day-story-ruth-calderon/
https://ebookmeta.com/product/the-observational-method-in-civil-
engineering-minimising-risk-maximising-value-first-edition-
powderham/
https://ebookmeta.com/product/encyclopedia-of-gender-in-
media-1st-edition-mary-kosut/
Create Stunning Renders Using V-Ray in 3ds Max: Guiding
the Next Generation of 3D Renderers 1st Edition
Margarita Nikita
https://ebookmeta.com/product/create-stunning-renders-using-v-
ray-in-3ds-max-guiding-the-next-generation-of-3d-renderers-1st-
edition-margarita-nikita/
Arduino and Raspberry Pi Sensor
Projectsfor the Evil Genius™
Arduino and Raspberry Pi Sensor
Projects for the Evil Genius™
Robert Chin
McGraw-Hill Education books are available at special quantity discounts to use as premiums and sales
promotions or for use in corporate training programs. To contact a representative, please visit the Contact
Us page at www.mhprofessional.com.
Copyright © 2018 by McGraw-Hill Education. All rights reserved. Printed in the United States of America.
Except as permitted under the United States Copyright Act of 1976, no part of this publication may be
reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without
the prior written permission of the publisher.
McGraw-Hill Education, the McGraw-Hill Education logo, Evil Genius and TAB, and related trade dress
are trademarks or registered trademarks of McGraw-Hill Education and/or its affiliates in the United States
and other countries and may not be used without written permission. All other trademarks are the property
of their respective owners. McGraw-Hill Education is not associated with any product or vendor mentioned
in this book.
1 2 3 4 5 6 7 8 9 DSS 22 21 20 19 18 17
ISBN 978-1-260-01089-3
MHID 1-260-01089-9
e-ISBN 978-1-260-01090-9
e-MHID 1-260-01090-2
Sponsoring Editor
Michael McCabe
Editorial Supervisor
Donna M. Martone Production Supervisor
Lynn M. Messina
Acquisitions Coordinator
Lauren Rogers
Project Manager
Patricia Wallenburg, TypeWriting
Copy Editor
James Madru
Proofreader
Claire Splan
Indexer
Claire Splan
Art Director, Cover
Jeff Weeks
Composition
TypeWriting
Information contained in this work has been obtained by McGraw-Hill Education from sources believed to
be reliable. However, neither McGraw-Hill Education nor its authors guarantee the accuracy or
completeness of any information published herein, and neither McGraw-Hill Education nor its authors shall
be responsible for any errors, omissions, or damages arising out of use of this information.
About the Author
THIS CHAPTER WILL INTRODUCE YOU to the Arduino and the Raspberry Pi. First, I
give a brief explanation of what the Arduino is. Then I specifically address the
Arduino Uno, discussing its general features, including its capabilities and key
functional components. This is followed by a discussion of the Arduino
Integrated Development Environment (IDE) software, which is needed to
develop programs for the Arduino. Each key function of the Arduino IDE is
reviewed, followed by a hands-on example giving detailed step-by-step
instructions on how to set up the Arduino for development and how to run and
modify an example program using the Arduino IDE. Next comes the Raspberry
Pi. I discuss what the Raspberry Pi is and the specifications for the Raspberry Pi
3. This section tells you how to set up the Raspberry Pi before using it for the
first time. Raspberry Pi hardware features are addressed, including the general
purpose input-output (GPiO) pin specifications. The final section includes a
hands-on example of how to control a light-emitting diode (LED) using the
Raspberry Pi.
What Is an Arduino?
The Arduino is an open-source microcontroller that uses the C and C++
languages to control digital and analog outputs to devices and electronic
components and to read in digital and analog inputs from other devices and
electronic components for processing. For example, an Arduino can read a signal
from a sensor in a home security system that detects the heat that a human being
emits. The sensor sends a signal to the Arduino indicating that a person is in the
home. After receiving this information, the Arduino can send commands to a
camera such as the ArduCAM Mini digital camera to start taking pictures of the
intruder. There are many different Arduino models out there. However, to create
the examples in this book, you will need an Arduino model with enough pins to
connect the components you desire, such as a camera, Bluetooth adapter, and/or
motion sensor. Figure 1-1 shows the official Arduino logo.
Arduino Uno
There are a great many Arduino products out there, ranging from models that are
small and can actually be worn by the user to models with many digital and
analog input-output pins. For the projects in this book, I recommend the Arduino
Uno, which is an open-source microcontroller that has enough digital ports to
accommodate a camera, a Secure Digital (SD) card reader/writer with enough
digital and analog ports for other devices, sensors, lights, and any other gadgets
that you may require for your own custom projects. The official Arduino Uno
board is made by a company called Arduino SRL, formerly Smart Projects,
formed by one of the founders of the Arduino (Figure 1-2). The newer official
Arduino Uno boards are slightly different in that they are more blue-green
instead of blue in color and contain the Genuino logo under the main Arduino
logo. The Genuino trademark is used outside the United States as a result of the
split between Arduino founders.
Figure 1-2 The official Arduino Uno.
There are also unofficial Arduino Uno boards made by other companies. A
good way to tell whether a board is official or unofficial is by the color of a
component that is located near the Arduino’s USB port. This component on an
official Arduino board is a metallic gold color. The component on an unofficial
board is green. The writing on the components also differs (Figure 1-3).
Figure 1-3 Metallic gold colored component on an official Arduino Uno board.
Reset Button
There is a Reset button on the Arduino Uno that you can press to reset the board.
This restarts the program contained in the Arduino’s memory (Figure 1-7).
Digital Pins
The Arduino Uno has many digital pins capable of simulating analog output
through the process of pulse-width modulation (PWM). For example, a LED
light generally has only two modes: on (full brightness) and off (no light
emitted). However, with digital PWM, the LED light can appear to have a
brightness in between on and off. For instance, with PWM, a LED can start from
an off state and slowly brighten until it is at its highest brightness level and then
slowly dim until back to the off state. The digital pins on the Arduino Uno are
pins 0 through 13. These PWM-capable digital pins are circled in Figure 1-8.
Communication
The communication section of the Arduino Uno contains pins for serial
communication between the Arduino and other devices, such as a Bluetooth
adapter or a personal computer. The Tx0 and Rx0 pins are connected to the USB
port and are used for communication between your Arduino and your computer
by means of a USB cable. The Serial Monitor that can be used for sending data
to the Arduino and reading data from the Arduino uses the Tx0 and Rx0 pins.
Thus you should not connect anything to these pins if you want to use the Serial
Monitor to debug your Arduino programs or to receive user input (Figure 1-9). I
will talk more about the Serial Monitor later in this book.
Figure 1-9 Arduino Uno serial communication.
The I2C interface consists of an SDA pin (which is pin 4) that is used for
data and an SCL pin (which is pin 5) that is used for clocking or driving the
device or devices attached to the I2C interface. The SDA and SCL pins are
circled in Figure 1-10.
Figure 1-10 Arduino Uno I2C interface.
Analog Input
The Arduino Uno has six analog input pins that can read in a range of values
instead of just digital values of 0 or 1. The analog input pin uses a 10-bit analog-
to-digital converter to transform voltage input in the range of 0 to 5 V into a
number in the range between 0 and 1,023 (Figure 1-11).
Figure 1-11 Arduino Uno analog input.
Power
The Arduino Uno has outputs for 3.3 and 5 V. One section that provides power is
located on the side of the Arduino. You can also provide a separate power source
by connecting the positive terminal of the power source to the Vin pin and the
ground of the power source to the Arduino’s ground. Make sure that the voltage
being supplied is within the Arduino’s voltage range (Figure 1-12).
Figure 1-12 Arduino Uno 3.3- and 5-V power outputs.
The ground connections on the Arduino Uno are shown circled in Figure 1-
13.
Figure 1-13 Arduino Uno ground connections.
Windows
Windows Installer. This is an .exe file that must be run to install the Arduino
IDE.
Windows zip file for non-administrator install. This is a zip file that must be
uncompressed in order to install the Arduino IDE. 7-zip is a free file
compression and uncompression program available at www.7-zip.org that can
be used to uncompress this program.
An Important Note: For Windows XP, I recommend the 1.0.5 r2 version of the Arduino IDE.
Later versions may not be stable and may terminate unexpectedly, behave erratically, or
may not be able to compile Arduino source code.
Mac
Mac OS X 10.7 Lion or newer. This is a zip file that must be uncompressed
and installed for users of the Mac operating system.
Linux
Linux 32 bits. Installation file for the Linux 32-bit operating system.
Linux 64 bits. Installation file for the Linux 64-bit operating system.
The easiest and cheapest way to start Arduino development is probably by
using the Windows version on an older operating system such as Windows XP.
In fact, the examples in this book were created using the Windows version of the
Arduino IDE running on Windows XP. There are in fact many sellers on Ebay
from whom you can buy a used Windows XP computer for around $50 to $100.
If you are starting from scratch and are looking for an inexpensive development
system for the Arduino, consider buying a used computer with Windows XP. The
only caution is that support for Windows XP has ended in the United States and
some other parts of the world. In China, Windows XP may still be supported
with software updates such as security patches.
The Verify button checks to see whether the program you have entered into
the Arduino IDE is valid and without errors (Figure 1-15). These uncompiled
programs are called sketches.
Figure 1-15 The Verify button.
The Upload button first verifies that the program in the IDE is a valid C/C++
program with no errors, compiles the program into a form the Arduino can
execute, and then finally transfers the program via the USB cable connected to
your computer to your Arduino board (Figure 1-16).
The New File button creates a new blank file or sketch inside the Arduino
IDE, where you can create your own C/C++ program for verification,
compilation, and transfer to the Arduino (Figure 1-17).
The Open File button is used to open and load the Arduino C/C++ program
source code from a file or load various sample source codes from example
Arduino projects that are included with the IDE (Figure 1-18).
Figure 1-18 The Open File button.
The Save button saves the sketch on which you are currently working to
disk. A File Save dialog is brought up first, and then you will be able to save the
file on your computer’s hard drive (Figure 1-19).
The Serial Monitor button brings up the Serial Monitor debug program,
where you can examine the output of debug statements from the Arduino
program. The Serial Monitor can also accept user input that can be processed by
the Arduino program (Figure 1-20). I will discuss the Serial Monitor and how to
use it as a debugger and input console later in this book.
The main window of the Arduino IDE also includes other important features.
The title bar of the IDE window contains the Arduino IDE version number. In
Figure 1-21, the Arduino version number is 1.0.5 r2. The sketch name is
displayed in the source code tab and is “Blink,” which is one of the sample
sketches that comes with the Arduino IDE. The source code area, which is the
large white area with scrollbars on the right side and bottom, is where you enter
your C/C++ source code that will control the behavior of the Arduino. The
bottom black area in the IDE is where warning and errors are displayed from the
code verification process. At the bottom left-hand corner of the IDE is a number
that represents the line number in the source code where the user’s cursor is
currently located. In the lower right-hand corner of the IDE is the currently
selected Arduino model and COM port to which the Arduino is attached.
Note: The Arduino website also contains links to instructions for installing the Arduino IDE
for Windows, Mac, and Linux at www.arduino.cc/en/Guide/HomePage. The installation for
Linux depends on the exact version of Linux being used.
The code that is loaded into the Arduino IDE should look like the code in
Listing 1-1.
If you are using a Mac, then the serial port selection should be something
like “/dev/tty.usbmodem” instead of a COMxx value.
Next, with the Arduino connected, press the Upload button to verify,
compile, and then transfer the “Blink” example program to the Arduino. After
the program has finished uploading, you should see a message that the upload
has been completed in the Warnings/error window at the bottom of the IDE
inside the black window (Figure 1-27).
Note: The Upload button does the job of the Verify button and also uploads the final
compiled program to the Arduino.
Final Result
The final result will be a blinking light on the Arduino board near digital pin 13.
By design, the Arduino board has a built-in LED connected to pin 13. So this
example did not require you to connect an actual separate LED to the Arduino
board (Figure 1-28).
Raspberry Pi 3 Model B
Many models of the Raspberry Pi have been produced, but the type of Raspberry
Pi that I will use in this book is the newest and most popular Raspberry Pi: the
Raspberry Pi 3 Model B. This model replaces the Raspberry Pi 2 and is
recommended for use in schools and for general purpose use. For those who
want to embed a Raspberry Pi as part of a larger project or require a Raspberry
Pi that uses low power, then the Raspberry Pi 0 or Model A+ is recommended.
The specifications of the Raspberry Pi 3 Model B are as follows:
1.2-GHz 64-bit quad-core ARMv8 CPU
802.11n wireless LAN
Bluetooth 4.1
Bluetooth Low Energy (BLE) 1-GB RAM
Four USB ports 40 GPiO pins Full HDMI port Ethernet port Combined
3.5-mm audio jack and composite video Camera interface (CSI) Display
interface (DSI)
Micro SD card slot (now push-pull rather than push-push) VideoCore IV 3D
graphics core
With the Raspberry Pi oriented like the one in Figure 1-29, the GPiO pin
specifications are as shown in Figure 1-31.
Figure 1-31 Raspberry Pi 2 and Raspberry Pi 3 GPiO pin numbering.
From within the IDLE program you can also create and save new files. An
alternative to using IDLE to create Python programs is to use a text editor such
as Vim, Nano, or LeafPad and execute the Python program by typing “python
filename.py” on the command line.
Hands-on Example:
A Simple Raspberry Pi “Hello World” Program
with a LED
This section presents a simple hands-on example of creating a blinking LED
using the Raspberry Pi 3.
Parts List
For this hands-on example, you will need
One LED
One breadboard Two wires with one end having a female plug to connect to
the Raspberry Pi’s GPiO pins and the other end having a male plug to connect
to the breadboard
1
he Wreathes of Glory, you affect,
But, meanes to gaine them, you neglect;
And, (though in doing, you delight)
You doe not, alwayes, what is right:
Nor are you growne, as yet, so wise,
To know, to whom the richest Prize
Doth appertaine; nor what it is.
But, now, you are inform'd of This.
See, Emblem I.
2
Though you are weake, you much may doe,
If you will set your Wits thereto.
For, meaner Powres, than you have had,
And, meaner Wits, good shift have made,
Both to contrive, and compasse that,
Which abler men have wondred at.
Your Strength, and Wit, unite, therefore,
And, both shall grow improov'd the more.
See, Emb. II.
3
Perhaps, thou mayst be one of them,
Who, Civill Magistrates contemne;
And sleighteth, or else, flouteth at
The Ceremonies of Estate.
That, thou maist, therefore, learne to get,
Both better Manners, and more Wit,
The Sword, and Mace, (by some despiz'd)
Is, for thy sake, now moralliz'd.
See, Emb. III.
4
By this thy Lot, wee may misdoubt,
Thou look'st not warily about;
But, hudlest onward, without heed,
What went before, or may succeed;
Procuring losse, or discontent,
Which, Circumspection, might prevent.
Therefore, with gratefulnesse, receive
Those counsells, which our Moralls give.
See, Emb. IV.
5
Thou hast, unworthily, repin'd,
Or, been displeased in thy mind,
Because, thy Fortunes doe not seeme
To fit thy Worth (in thy esteeme:)
And loe, to check thy discontent,
Thy Lot, a Morall, doth present;
And shewes, that, if thou vertuous bee,
Good-Fortune, will attend on thee.
See, Emb. V.
6
When thy Desires have good successe,
Thine owne Endeavors, thou dost blesse;
But, seldome unto God thou giv'st
Due thanks, for that, which thou receiv'st.
Thine Emblem, therefore, tells from whom
The fruits of good Endeavours, come:
And, shewes (if thou to thrive intend)
On whom, thou, alwayes, must depend.
See, Emb. VI.
7
It may bee, thou art one of those,
Whose Faith, more bold, than fruitfull growes;
And (building on some false Decree)
Disheartnest those, that Workers be
To gaine (with awfull-joy) that PriZe,
Which, unto no man, God denies,
That workes in Hope; and, lives by Faith.
Marke, therefore, what thine Emblem saith.
See, Emb. VII.
8
Thou hast been willing, that thy Name,
Should live the life of Honest-Fame;
And, that, thy labours (to thy praise)
Continue might, in future dayes.
Behold; the Lot, thou hapnest on,
Hath showne, how this may well bee done.
Pursue the Course, which there is taught,
And, thy desires to passe are brought.
See, Emb. VIII.
9
Thou, many things, hast well begun;
But, little, to good purpose, done:
Because, thou hast a fickle braine,
And, hands that love to take no paine.
Therefore, it chanceth not amisse,
That, thou hast such a Chance, as this:
For, if thou want not Grace, or Wit,
Thou maist, in time, have good of it.
See, Emb. IX.
10
Whatev'r you seeme to others, now,
It was the Harrow, and the Plough,
By which, your Predecessors got,
The fairest portion of your Lot:
And, (that, it may encrease your Wit)
They haunt you, in an Emblem, yet.
Peruse our Morall; and, perchance,
Your Profit, it will much advance.
See, Emb. X.
11
Much labour, and much time you spend,
To get an able-constant Friend:
But, you have ever sought him, there,
Where, no such precious Iewells are:
For, you, without have searching bin,
To finde, what must be found within.
This Friend, is mention'd by this Lot,
But, God knowes where he may be got.
See, Emb. XI.
12
Thou seek'st for Fame; and, now art showne,
For what, her Trumpet shall be blowne.
Thine Emblem, also, doth declare,
What Fame they get, who vertuous are,
For Praise alone; and, what Reward,
For such like Studies, is prepar'd.
Peruse it; And, this Counsell take;
Bee vertuous, for meere Vertues sake.
See, Emb. XI.
13
This Lot, those persons, alwayes finds,
That have high thoughts, and loftie minds;
Or, such as have an itch to learne,
That, which doth nothing them concerne;
Or, love to peepe, with daring eyes,
Into forbidden Mysteries.
If any one of these thou bee,
Thine Emblem, lessons hath for thee.
See, Emb. XIII.
14
If all be true, these Lots doe tell us,
Thou shouldst be of those Fidling-fellowes,
Who, better practised are growne,
In others matters, than their owne:
Or, one, that covets to be thought,
A man, that's ignorant of nought.
If it be so, thy Morall showes
Thy Folly, and what from it flowes.
See, Emb. XIV.
15
Thou hast some Charge, (who e're thou be)
Which, Tendance may expect from thee.
And, well, perhaps, it may be fear'd,
Tis often left, without regard:
Or, that, thou dost securely sleep,
When, thou should'st watch, more strictly, keep.
Thou knowest best, if it be so:
Take therefore heed, what is to doe.
See, Emb. XV.
16
In secret, thou dost oft complaine,
That, thou hast hop'd, and wrought in vaine;
And, think'st thy Lot, is farre more hard,
Than what for others is prepar'd.
An Emblem, therefore, thou hast got,
To shew, it is our common-Lot,
To worke and hope; and, that, thou hast
A Blessing by it, at the last.
See, Emb. XVI.
17
That thou hast Honestie, we grant;
But, Prudence, thou dost often want:
And, therefore, some have injur'd thee,
Who farre more Wise, than honest bee.
That, now, Discretion thou mayst add,
To those good-meanings thou hast had;
The Morall of thine Emblem, view;
And, what it counsels, that, pursue.
See, Emb. XVII.
18
To your Long-home, you nearer are,
Than you (it may bee) are aware:
Yea, and more easie is the Way,
Than you, perchance, conceive it may.
Lest, therefore, Death, should grim appeare,
And, put you in a causelesse feare;
(Or out of minding wholly passe)
This Chance, to you allotted was.
See, Emb. XVIII.
19
In slippery Paths, you are to goe;
Yea, they are full of danger too:
And, if you heedfull should not grow,
They'l hazzard much, your overthrow.
But, you the mischiefe may eschew,
If wholsome Counsell, you pursue.
Looke, therefore, what you may be taught,
By that, which this your chance hath brought.
See, Emb. XIX.
20
This present Lot, concernes full neere,
Not you alone, but all men here;
For, all of us, too little heed
His love, who for our sakes, did bleed.
Tis true, that meanes, hee left behind him,
Which better teacheth how to minde him:
Yet, if wee both by that, and this,
Remember him, 'tis not amisse.
See, Emb. XX.
21
Tis hop'd, you just, and pious are,
More out of Conscience, than for feare;
And, that you'l vertuous courses take,
For Goodnesse, and for Vertue-sake.
Yet, since the best men, sometimes may
Have need of helpes, in Vertues way,
Those usefull Moralls, sleight you not,
Which are presented by this Lot.
See, Emb. XXI.
22
This Lot pertaineth unto those,
(And who they bee, God onely knowes)
Who, to the world, have no desire;
But, up to heav'nly things aspire.
No doubt, but you, in some degree,
Indow'd with such affections bee;
And, had this Emblem, that you might
Encourag'd bee, in such a Flight.
See, Emb. XXII.
23
The state of Temp'rall things to shew,
Yee have them, still, within your view;
For, ev'ry object that wee see,
An Emblem, of them, serves to bee.
But, wee from few things, helps doe finde,
To keepe Eternitie in minde.
This Lot, an Emblem brings, therefore,
To make you thinke upon it more.
See, Emb. XXIII.
24
Vnlesse you better looke thereto,
Dis-use, and Sloth, will you undoe.
That, which of you despayred was,
With ease, might have bin brought to passe;
Had but so much bin done, as may
Bee equall'd with One Line a day.
Consider this; and, to that end,
The Morall of your Lot attend.
See, Emb. XXIV.
M 25
If wee mistake not, thou art one,
Who loves to court the Rising-Sunne;
And, if this Lot, thy nature finde,
Thou to Preferment hast a minde:
If so; learne hence, by whose respect
(Next God) thou mayst thy hopes effect:
Then, seeke to winn his grace to thee,
Of what estate soe're thou bee.
See, Emb. XXV.
26
Thou to a double-path art come;
And, peradventure, troublesome,
Thou findest it; for thee to know,
On whether hand thou oughtst to goe.
To put thee out of all suspect,
Of Courses that are indirect;
Thy Morall points thee to a path,
Which hardship, but, no perill hath.
See, Emb. XXVI.
27
You warned are of taking heede,
That, never, you your Bounds exceed;
And, also, that you be not found,
To come within your Neighbours Bound.
There may be some concealed Cause,
That, none but you, this Emblem drawes.
Examine it; And, If you see
A fault, let it amended be.
See, Emb. XXVII.
28
Your Emblems morall doth declare,
When, Lovers fitly matched are;
And, what the chiefest cause may be,
Why, Friends and Lovers disagree.
Perhaps, you somewhat thence may learne,
Which your Affection doth concerne.
But, if it Counsell you too late,
Then, preach it at your Neighbours gate.
See, Emb. XXVIII.
M 29
Some, vrge their Princes on to Warre,
And weary of sweet Peace, they are.
Some, seeke to make them, dote on Peace,
(Till publike Danger more encrease)
As if the World were kept in awe,
By nothing else but preaching Law.
Thy Morall (if of those thou art)
Doth act a Moderators part.
See, Emb. XXIX.
30
Tis feared, thou dost lesse esteeme,
Vpright to bee, than so to seeme;
And, if thine actions, faire appeare,
Thou carest not how foule they are.
Though this bee not thy fault alone,
Yet have a care of mending One:
And, study thou, Vpright to grow,
As well in Essence, as in Show.
See, Emb. XXX.
31
Some, all their time, and wealth have spent,
In giving other men content;
And, would not grudge to waste their Blood,
To helpe advance the Common-good.
To such as these, you have been thought,
Not halfe so friendly as you ought.
This Lot therefore befalls, to shew,
How great respects, to such, are due.
See, Emb. XXXI.
32
You have been tempted (by your leave)
In hope of Lucre, to deceive:
But, much, as yet, you have not swerv'd
From Faith, which ought to be observ'd.
If well, hereafter, you would speed,
In dealing-honestly, proceed:
For, by your Emblem, you shall see,
That, Honest-men, the richest bee.
See, Emb. XXXII.
33
We hope, no person, here, beleeves,
That, you are of those wealthy Theeves,
Who, Chaines of gold, and pearle doe weare.
And, of those Theeves, that, none you are,
Which weares a Rope, wee, plainly see;
For, you, as yet unhanged bee:
But, unto God, for Mercie crie,
Else hang'd you may bee, e're you die.
See, Emb. XXXIII.
34
You, willing are, to put away,
The thinking on your latter-day:
You count the mention of it, Folly;
A meanes of breeding Melancholly;
And, newes unfit for men to heare,
Before they come to sixtie-yeare.
But, minde what Counsels now are sent,
And, mend, lest you too late repent.
See, Emb. XXXIV.
35
Your Wits, your Wishes, and your Tongue,
Have run the Wild goose-chase, too long;
And (lest all Reason, you exceed)
Of Rules, and Reines, you now have need.
A Bridle, therefore, and a Square,
Prime Figures, in your Emblem, are.
Observe their Morall, and I pray,
Be Wise, and Sober, if you may.
See, Emb. XXXV.
36
Because her Ayd makes goodly showes,
You, on the World, your trust repose;
And, his dependance, you despise,
Who, meerly, on God's helpe, relies.
That, therefore, you may come to see,
How pleas'd, and safe, those men may bee,
Who have no ayd, but God, alone;
This Emblem, you have lighted on.
See, Emb. XXXVI.
37
Some, thinke your Vertue very much;
And, there is cause to thinke it such:
For, many wayes it hath been tride;
And, well the Triall doth abide.
Yet, think not, but some brunts there are,
Which, your owne strength shall never beare.
And, by the Morall of your Lot,
Learne, where, Assistance may bee got.
See, Emb. XXXVII.
38
Thou hast been grieved, and complain'd,
Because, the Truth hath wrong sustain'd.
But, that, dismayd thou shouldst not be,
Thine Emblem will declare to thee,
That, though the Truth may suffer spite,
It shall not bee depressed quite;
But, by opposing, spread the more,
And, grow more pow'rfull than before.
See, Emb. XXXVIII.
39
By Rashnesse, thou hast often err'd,
Or, else, thou hadst been more preferr'd.
But, future errours, to prevent,
Thou to the slow-pac'd Oxe art sent,
To learne more Staydnesse; and, to doe
Thy Workes, with Perseverance, too.
Hee that this creatures Vertue scornes,
May want it all, except his Hornes.
See, Emb. XXXIX.
40
Dame Fortunes favour seemes to bee
Much lov'd, and longed for, of thee;
As if, in what, her hand bestowes,
Thou mightst thy confidence repose.
But, that, her manners may bee knowne,
This Chance, upon thee, was bestowne.
Consider well, what thou hast got,
And, on her flattrings, dote thou not.
See, Emb. XL.
41
The Steele and Flint, declare, in part,
The Temper of a Stony-heart;
And, shewe, that thence, no Vertue flowes,
Till it be forced out, with blowes.
Some other, Moralls thou maist learne,
Thereby, which will thy good, concerne:
Marke, therefore, what they doe declare,
And, minde it, as occasions are.
See, Emb. XLI.
42
Thou thinkst thy Witt, had made thee great,
Had Povertie not beene some let:
But, had thy Wealth as ample beene,
As, thou thy Witt, didst overweene;
Insteed of thy desired Height,
Perhaps, thou hadst beene ruin'd quite.
Hereafter, therefore, be content,
With whatsoever God hath sent.
See, Emb. XLII.
43
To Discord, thou art somewhat prone,
And, thinkst thou mayst subsist alone;
Regarding not how safe they bide,
Who, fast, in Concords bands are tide.
But, that thou mayst the better heed,
What Good, from Vnion doth proceed,
An Emblem is become thy Lot,
From which, good Caveats may be got.
See, Emb. XLIII.
44
Thou wouldst be lov'd; and, to that end,
Thou dost both Time, and Labour spend:
But, thou expect'st (as wee beleeve)
More Love, than thou dost meane to give.
If so thou then, art much to blame:
For, Love affects a muturall-flame;
Which, if it faile on either side,
Will never, long time, true abide.
See, Emb. XLIV.
45