100% found this document useful (1 vote)
21 views

Programming Arduino: Getting Started with Sketches (Tab) Monk - The ebook in PDF/DOCX format is available for instant download

The document promotes the book 'Programming Arduino: Getting Started with Sketches' by Simon Monk, highlighting its focus on programming Arduino boards for beginners. It provides links to download the book and other related titles from ebookmass.com. Additionally, it outlines the book's structure, covering topics from basic Arduino concepts to advanced programming techniques, including IoT applications.

Uploaded by

ajejizelia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
21 views

Programming Arduino: Getting Started with Sketches (Tab) Monk - The ebook in PDF/DOCX format is available for instant download

The document promotes the book 'Programming Arduino: Getting Started with Sketches' by Simon Monk, highlighting its focus on programming Arduino boards for beginners. It provides links to download the book and other related titles from ebookmass.com. Additionally, it outlines the book's structure, covering topics from basic Arduino concepts to advanced programming techniques, including IoT applications.

Uploaded by

ajejizelia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Visit ebookmass.

com to download the full version and


explore more ebook or textbook

Programming Arduino: Getting Started with Sketches


(Tab) Monk

_____ Click the link below to download _____


https://ebookmass.com/product/programming-arduino-getting-
started-with-sketches-tab-monk/

Explore and download more ebook or textbook at ebookmass.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Programming Arduino: Getting Started with Sketches, Third


Edition Simon Monk

https://ebookmass.com/product/programming-arduino-getting-started-
with-sketches-third-edition-simon-monk/

Programming Arduino: Getting Started with Sketches 3rd


Edition Simon Monk

https://ebookmass.com/product/programming-arduino-getting-started-
with-sketches-3rd-edition-simon-monk/

Programming Arduino Next Steps: Going Further with


Sketches 2nd Edition Simon Monk

https://ebookmass.com/product/programming-arduino-next-steps-going-
further-with-sketches-2nd-edition-simon-monk/

Programming the Raspberry Pi, Third Edition: Getting


Started with Python Simon Monk

https://ebookmass.com/product/programming-the-raspberry-pi-third-
edition-getting-started-with-python-simon-monk/
Programming the Intel Galileo: Getting Started with the
Arduino -Compatible Development Board Christopher Rush

https://ebookmass.com/product/programming-the-intel-galileo-getting-
started-with-the-arduino-compatible-development-board-christopher-
rush/

Programming the Photon: Getting Started with the Internet


of Things Rush Christopher.

https://ebookmass.com/product/programming-the-photon-getting-started-
with-the-internet-of-things-rush-christopher/

Programming With STM32: Getting Started With the Nucleo


Board and C/C++ Donald Norris

https://ebookmass.com/product/programming-with-stm32-getting-started-
with-the-nucleo-board-and-c-c-donald-norris/

Programming the Photon: Getting Started with the Internet


of Things (Tab) Christopher Rush

https://ebookmass.com/product/programming-the-photon-getting-started-
with-the-internet-of-things-tab-christopher-rush/

Hacking Electronics: Learning Electronics with Arduino and


Raspberry Pi, 2nd Edition Simon Monk

https://ebookmass.com/product/hacking-electronics-learning-
electronics-with-arduino-and-raspberry-pi-2nd-edition-simon-monk/
Programming Arduino™
Getting Started with Sketches

SECOND EDITION

Simon Monk

New York Chicago San Francisco


Athens London Madrid
Mexico City Milan New Delhi
Singapore Sydney Toronto
Library of Congress Control Number: 2016938700

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.mheducation.com .

Programming Arduino™: Getting Started with Sketches, Second Edition

Copyright © 2016, 2012 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, with the exception that the program listings may be entered, stored, and executed
in a computer system, but they may not be reproduced for publication.
McGraw-Hill Education, the McGraw-Hill Education logo, 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.
Arduino is a trademark of Arduino LLC.
1 2 3 4 5 6 7 8 9 DOC 21 20 19 18 17 16

ISBN 978-1-25-964163-3
MHID 1-25-964163-5

This book is printed on acid-free paper.

Sponsoring Editor
Michael McCabe
Editorial Supervisor
Stephen M. Smith
Production Supervisor
Pamela A. Pelton
Acquisitions Coordinator
Lauren Rogers
Project Manager
Srishti Malasi,
Cenveo® Publisher Services
Copy Editor
Claire Splan
Proofreader
Cenveo Publisher Services
Indexer
Jack Lewis
Art Director, Cover
Jeff Weeks
Illustration
Cenveo Publisher Services
Composition
Cenveo Publisher Services

Information has been obtained by McGraw-Hill Education from sources believed to be


reliable. However, because of the possibility of human or mechanical error by our sources,
McGraw-Hill Education, or others, McGraw-Hill Education does not guarantee the accuracy,
adequacy, or completeness of any information and is not responsible for any errors or
omissions or the results obtained from the use of such information.
To my boys, Stephen and Matthew, from a very proud Dad.
About the Author
Simon Monk has a bachelor’s degree in cybernetics and computer
science and a doctorate in software engineering. He has been an
active electronics hobbyist since his school days and is an
occasional author in hobby electronics magazines. Dr. Monk is also
author of some 20 books on Maker and electronics topics, especially
Arduino and Raspberry Pi. You can find out more about his books at
http://simonmonk.org . You can also follow him on Twitter, where he
is @simonmonk2.
CONTENTS
Preface
Acknowledgments
Introduction

1 This Is Arduino
Microcontrollers
Development Boards
A Tour of an Arduino Board
Power Supply
Power Connections
Analog Inputs
Digital Connections
Microcontroller
Other Components
The Origins of Arduino
The Arduino Family
Uno and Leonardo
Mega and Due
The Micro and Small Arduino Boards
Yun
Lilypad
Other “Official” Boards
Arduino Clones and Variants
Conclusion
2 Getting Started
Powering Up
Installing the Software
Uploading Your First Sketch
The Arduino Application
Conclusion

3 C Language Basics
Programming
What Is a Programming Language?
Blink—Again!
Variables
Experiments in C
Numeric Variables and Arithmetic
Commands
if
for
while
Constants
Conclusion

4 Functions
What Is a Function?
Parameters
Global, Local, and Static Variables
Return Values
Other Variable Types
floats
boolean
Other Data Types
Coding Style
Indentation
Opening Braces
Whitespace
Comments
Conclusion

5 Arrays and Strings


Arrays
Morse Code SOS Using Arrays
String Arrays
String Literals
String Variables
A Morse Code Translator
Data
Globals and Setup
The loop Function
The flashSequence Function
The flashDotOrDash Function
Putting It All Together
Conclusion

6 Input and Output


Digital Outputs
Digital Inputs
Pull-Up Resistors
Internal Pull-Up Resistors
Debouncing
Analog Outputs
Analog Input
Conclusion

7 The Standard Arduino Library


Random Numbers
Math Functions
Bit Manipulation
Advanced I/O
Generating Tones
Feeding Shift Registers
Interrupts
Conclusion

8 Data Storage
Constants
Storing Data in Flash Memory
EEPROM
Storing an int in EEPROM
Using the AVR EEPROM Library
Storing a float in EEPROM
Storing a String in EEPROM
Clearing the Contents of EEPROM
Compression
Range Compression
Conclusion
Visit https://ebookmass.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
9 Displays
Alphanumeric LCD Displays
A USB Message Board
Using the Display
Other LCD Library Functions
OLED Graphic Displays
Connecting an OLED Display
Software
Conclusion

10 Arduino Internet of Things Programming


Communicating with Web Servers
HTTP
HTML
Arduino Uno as a Web Server
Web-Controlled Arduino
Node MCU Web Server
Web-Controlled Node MCU
Calling Web Services
Arduino Uno and IFTTT
Node MCU ESP8266 Board and IFTTT
Other IoT Options
Arduino Yun
Particle Photon
Conclusion

11 C++ and Libraries


Object Orientation
Classes and Methods
Built-In Library Example
Writing Libraries
The Header File
The Implementation File
Completing Your Library
Conclusion

Index
PREFACE

The first edition of this book was published in November 2011 and
has been Amazon’s highest ranking book on Arduino.
At the time the book was originally written, the current Arduino
model was the Arduino 2009 and the software version was Beta018.
Almost at the time the book arrived in stores, the Arduino Uno and
version 1.0 of the Arduino software were released. Soon after, the
second printing of the book had a minor update to cover the new
board and software without formally being a second edition. This
edition brings the book fully up to date and is based on Arduino 1.6.
The Arduino Uno R3 is still considered to be the standard
Arduino board. However, many other boards, including both official
Arduino boards (like the Leonardo, Zero, 101, Due, and Yun) and
other Arduino programming language–based devices like the Photon
and Intel Edison, have also appeared.
This edition also addresses the use of Arduino in IoT (Internet of
Things) projects and the use of various types of display including
OLED and LCD.
Simon Monk
ACKNOWLEDGMENTS

I thank Linda for giving me the time, space, and support to write
this book and for putting up with the various messes my projects
create around the house.
Many thanks to Robert “BobKat” Logan and the many other
eagle-eyed and helpful folk who reported errata for the first edition. I
have done my best to fix what you found.
Finally, I would like to thank Michael McCabe, Srishti Malasi, and
everyone involved in the production of this book. It’s a pleasure to
work with such a great team.
INTRODUCTION

Arduino interface boards provide a low-cost, easy-to-use


technology to create microcontroller-based projects. With a little
electronics, you can make your Arduino do all sorts of things, from
controlling lights in an art installation to managing the power on a
solar energy system.
There are many project-based books that show you how to
connect things to your Arduino, including 30 Arduino Projects for the
Evil Genius by this author. However, the focus of this book is on
programming the Arduino.
This book will explain how to make programming the Arduino
simple and enjoyable, avoiding the difficulties of uncooperative code
that so often afflict a project. You will be taken through the process of
programming the Arduino step by step, starting with the basics of the
C programming language that Arduinos use.

So, What Is Arduino?


Arduino is a small microcontroller board with a universal serial bus
(USB) plug to connect to your computer and a number of connection
sockets that can be wired to external electronics such as motors,
relays, light sensors, laser diodes, loudspeakers, microphones, and
more. They can be powered either through the USB connection from
the computer, from a 9V battery, or from a power supply. They can
be controlled from the computer or programmed by the computer
and then disconnected and allowed to work independently.
The board design is open source. This means that anyone is
allowed to make Arduino-compatible boards. This competition has
led to low costs for the boards and all sorts of variations on the
“standard” boards.
The basic boards are supplemented by accessory shield boards
that can be plugged on top of the Arduino board.
The software for programming your Arduino is easy to use and
also freely available for Windows, Mac, and Linux computers.

What Will I Need?


This is a book intended for beginners, but it is also intended to be
useful to those who have used Arduino for a while and want to learn
more about programming the Arduino or gain a better understanding
of the fundamentals. As such, this book concentrates on the use of
the Arduino Uno board; however, almost all of the code will work
unmodified on all the Arduino models and variants.
You do not need to have any programming experience or a
technical background, and the book’s exercises do not require any
soldering. All you need is the desire to make something.
If you want to make the most of the book and try out some of the
experiments, then it is useful to have the following on hand:
♦ A few lengths of solid core wire
♦ A cheap digital multimeter
Both are readily available for a few dollars from a hobby electronics
store or online retailer such as Adafruit or Sparkfun. You will of
course also need an Arduino Uno board.
If you want to go a step further and experiment with displays and
network connections, then you will need to buy shields that are
available from online stores. See Chapters 9 and 10 for details.
Using This Book
This book is structured to get you started in a really simple way and
gradually build on what you have learned. You may, however, find
yourself skipping or skimming some of the early chapters as you find
the right level to enter the book.
The book is organized into the following chapters:
♦ Chapter 1: This Is Arduino An introduction to the Arduino
hardware, this chapter describes what it is capable of and the
various types of Arduino boards that are available.
♦ Chapter 2: Getting Started Here you conduct your first
experiments with your Arduino board: installing the software,
powering it up, and uploading your first sketch.
♦ Chapter 3: C Language Basics This chapter covers the
basics of the C language; for complete programming
beginners, the chapter also serves as an introduction to
programming in general.
♦ Chapter 4: Functions This chapter explains the key concept of
using and writing functions in Arduino sketches. These
sketches are demonstrated throughout with runnable code
examples.
♦ Chapter 5: Arrays and Strings Here you learn how to make
and use data structures that are more advanced than simple
integer variables. A Morse code example project is slowly
developed to illustrate the concepts being explained.
♦ Chapter 6: Input and Output You learn how to use the digital
and analog inputs and outputs on the Arduino in your
programs. A multimeter will be useful to show you what is
happening on the Arduino’s input/output connections.
♦ Chapter 7: The Standard Arduino Library This chapter
explains how to make use of the standard Arduino functions
that come in the Arduino’s standard library.
♦ Chapter 8: Data Storage Here you learn how to write sketches
that can save data in electrically erasable read-only memory
(EEPROM) and make use of the Arduino’s built-in flash
memory.
♦ Chapter 9: Displays In this chapter, you learn how to interface
an Arduino with displays and to make a simple USB message
board.
♦ Chapter 10: Arduino Internet of Things Programming You
learn how to make the Arduino behave like a Web server and
communicate with the Internet using services such as dweet
and IFTTT.
♦ Chapter 11: C++ and Libraries You go beyond C, looking at
adding object orientation and writing your own Arduino libraries.

Resources
This book is supported by an accompanying website:
www.arduinobook.com
There you will find all the source code used in this book as well as
other resources, such as errata.
1
This Is Arduino

Arduino is a microcontroller platform that has captured the


imagination of electronics enthusiasts. Its ease of use and open
source nature make it a great choice for anyone wanting to build
electronic projects.
Ultimately, it allows you to connect electronics through its pins so
that it can control things—for instance, turn lights or motors on and
off or sense things such as light and temperature. This is why
Arduino is sometimes given the description physical computing.
Because Arduinos can be connected to your computer by a universal
serial bus (USB) lead, this also means that you can use the Arduino
as an interface board to control those same electronics from your
computer.
This chapter is an introduction to the Arduino, including the
history and background of the Arduino, as well as an overview of the
hardware.

Microcontrollers
The heart of your Arduino is a microcontroller. Pretty much
everything else on the board is concerned with providing the board
with power and allowing it to communicate with your desktop
computer.
A microcontroller really is a little computer on a chip. It has
everything and more than the first home computers had. It has a
processor, a kilobyte or two of random access memory (RAM) for
holding data, a few kilobytes of erasable programmable read-only
memory (EPROM) or flash memory for holding your programs and it
has input and output pins. These input/output (I/O) pins link the
microcontroller to the rest of your electronics.
Inputs can read both digital (is the switch on or off?) and analog
(what is the voltage at a pin?). This opens up the opportunity of
connecting many different types of sensor for light, temperature,
sound, and more.
Outputs can also be analog or digital. So, you can set a pin to be
on or off (0 volts or 5 volts) and this can turn light-emitting diodes
(LEDs) on and off directly, or you can use the output to control higher
power devices such as motors. They can also provide an analog
output. That is, you can control the power output of a pin, allowing
you to control the speed of a motor or the brightness of a light, rather
than simply turning it on or off.
The microcontroller on an Arduino Uno board is the 28-pin chip
fitted into a socket at the center of the board. This single chip
contains the memory, processor, and all the electronics for the
input/output pins. It is manufactured by the company Atmel, which is
one of the major microcontroller manufacturers. Each of the
microcontroller manufacturers actually produces dozens of different
microcontrollers grouped into different families. The microcontrollers
are not all created for the benefit of electronics hobbyists like us. We
are a small part of this vast market. These devices are really
intended for embedding into consumer products, including cars,
washing machines, DVD players, children’s toys, and even air
fresheners.
The great thing about the Arduino is that it reduces this
bewildering array of choices by standardizing on one microcontroller
and sticking with it. (Well, as we see later, this statement is not quite
true, but it’s close enough.)
This means that when you are embarking on a new project, you
do not first need to weigh all the pros and cons of the various flavors
Visit https://ebookmass.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
Other documents randomly have
different content
Till then, make use of your Philosophie. [Exit.

Soph. Stay, Dorigen: O me, inquisitive fool!


Thou that didst order this congested heap
When it was Chaos, 'twixt thy spacious palms
Forming it to this vast rotundie;
Dissolve it now; shuffle the elements,
That no one proper by it self may stand:
Let the sea quench the sun, and in that instant
The sun drink up the sea: day, ne'er come down,
To light me to those deeds that must be done.
[Exit.
Drums and Colours.
Enter Martius, Valerius, Captains and
soldiers, at one door, and Dorigen with
Lad[i]es, at another.
Dor. Hail, General of Rome; from Sophocles
That honors Martius, Dorigen presents
Her self to be dishonour'd: do thy will;
For Sophocles commands me to obey.
Come, violate all rules of holiness,
And rend the consecrated knot of love.

Mar. Never, Valerius, was I blest till now:


Behold the end of all my weary steps,
The prize of all my Battels: leave us all;
Leave us as quick as thought. Thus joy begin,
In zealous love a minutes loss is sin.

Val. Can Martius be so vile? or Dorigen?

Dor. Stay, stay, and monster, keep thou further of;


I thought thy brave soul would have much, much loath'd
To have gone on still on such terms as this.
See, thou ungrateful, since thy desperate lust
Nothing can cure but death, I'll die for thee,
Whilst my chaste name lives to posterity.

Mar. Live, live, thou Angel of thy sex: forgive,


Till by those golden tresses thou be'st snatch'd
Alive to Heaven: for thy corruption's
So little, that it cannot suffer death.
Was ever such a woman? O my mirror!
How perfectly thou shew'st me all my faults,
Which now I hate, and when I next attempt thee,
Let all the fires in the Zodiak
Drop on this cursed head.

All. O blest event!

Dor. Rise like the sun again in all his glory,


After a dark Eclipse.
Mar. Never without a pardon.

Enter Sophocles, and two or three with


him.
Dor. Sir, you have forgiven your self.

Soph. Behold their impudence: are my words just?


Unthankful man, viper to Arms, and Rome
Thy natural mother; have I warm'd thee here
To corrode ev'n my heart? Martius, prepare
To kill me, or be kill'd.

Mar. Why Sophocles?


Then prethee kill me; I deserve it highly;
For I have both transgress'd 'gainst men, and gods;
But am repentant now, and in best case
To uncase my soul of this oppressing flesh;
Which, though (Gods witness) nev'r was actually
Injurious to thy wife and thee, yet 't was
Her goodness that restrain'd and held me now:
But take my life, dear friend, for my intent,
Or else forgive it.

Val. By the gods of Athens,


These words are true, and all direct again.

Soph. Pardon me, Dorigen.

Mar. Forgive me, Sophocles,


And Dorigen too, and every one that 's good.

Dor. Rise, noble Roman, belov'd Sophocles,


Take to thy brest thy friend.

Mar. And to thy heart


Thy matchless wife: Heaven has not stuff enough
To make another such: for if it could,
Martius would marry too. For thy blest sake
(O thou infinitie of excellence)
Henceforth in mens discourse Rome shall not take
Th ll f Ath 't f B t h
The wall of Athens, as 'tofore. But when
In their fair honors we to speak do come,
We'll say 'T was so in Athens, and in Rome.

[Exeun[t] in pomp.
Diana descends.

Diana. Honor set ope thy gates, and with thee bring
My servant and thy friend, fair Dorigen:
Let her triumph, with her, her Lord, and friend,
Who, though misled, still honor was their end.
[Flourish.
Enter the Shew of Honors Triumph; a great flourish of Trumpets and
Drums within; Then enter a noise of Trumpets sounding cheerfully.
Then follows an armed Knight bearing a Crimson Banneret in hand,
with the inscription Valour: by his side a Lady, bearing a Watchet
Banneret, the inscription Clemencie: next Martius and Sophocles
with Coronets. Next, two Lad[i]es, one bearing a white Banneret, the
inscription Chastity: the other a black, the inscription Constancie.
Then Dorigen crown'd. Last, a Chariot drawn by two Moors, in it a
Person crown'd, with a Scepter: on the top, in an antick Scutcheon,
is written Honor. As they pass over, Diana ascends.
Rinald. How like you it?
Frig. Rarely; so well, I would they would do it again. How many of
our wives now adays would deserve to triumph in such a Chariot?
Rinald. That's all one; you see they triumph in Caroches.
Frig. That they do, by the mass; but not all neither; many of them
are content with Carts. But Seignior, I have now found out a great
absurditie i'faith.
Rinald. What was 't?
Frig. The Prologue presenting four Triumphs, made but three legs to
the King: a three-legged Prologue, 't was monstrous.
Rinald. 'T had been more monstrous to have had a four-legg'd one.
Peace, the King speaks.

Em. Here was a woman, Isabel.

Isa. I, my Lord,
But that she told a lye to vex her husband;
Therein sh[e] fail'd.

Em. She serv'd him well enough;


He that was so much man, yet would be cast
To jealousie for her integrity.
This teacheth us, the passion of love
Can fight with Soldiers, and with Scholars too.

Isa. In Martius, clemencie and valour shown,


In the other, courage and humanitie;
And therefore in the Triumph they were usher'd
By clemencie and valour.

Em. Rightly observ'd,


As she by chastitie and constancie;
What hurt's now in a Play, against which some rail
So vehemently? thou and I, my love,
Make excellent use methinks: I learn to be
A lawful lover void of jealousie,
And thou a constant wife. Sweet Poetry's
A flower, where men, like Bees and Spiders, may
Bear poison, or else sweets and Wax away.
Be venom-drawing Spiders they that will;
I'll be the Bee, and suck the honey still.
[Flourish.
Cupid descends.
Cupid. Stay, clouds, ye rack too fast: bright Phœbus see,
Honor has triumph'd with fair Chastity:
Give Love now leave, in purity to shew
Unchaste affe[ct]ions flie not from his bowe.
Produce the sweet example of your youth.
Whilst I provide a Triumph for your Truth.
[Flourish.
Enter Violanta (with childe) and Gerrard.
Viol. Why does my Gerr[a]rd grieve?

Ger. O my sweet Mistris,


'Tis not life (which by our Milain law
My fact hath forfeited) makes me thus pensive;
That I would lose to save the little finger
Of this your noble burthen, from least hurt,
Because your blood is in't. But since your love
Made poor incompatible me the parent,
(Being we are not married) your dear blood
Falls under the same cruel penalty;
And can Heaven think fit ye die for me?
For Heavens sake say I ravisht you, I'll swear it,
To keep your life, and repute unstain'd.

Viol. O Gerrard, th' art my life and faculties:


And if I lose thee, I'll not keep mine own;
The thought of whom, sweetens all miseries.
Wouldst have me murder thee beyond thy death?
Unjustly scandal thee with ravishment?
It was so far from rape, that Heaven doth know,
If ever the first Lovers, ere they fell,
Knew simply in the state of innocence,
Such was this act, this, that doth ask no blush.

Ger. O! but my rarest Violanta, when


My Lord Randulpho brother to you[r] father,
Shall understand this, how will he exclaim,
That my poor Aunt, and me, which his free alms
Hath nurs'd, since Millain by the Duke of Mantua
(Who now usurps it) was surpriz'd? that time
My father and my mother were both slain,
With my Aunts husband, as she says, their states
Despoil'd and seiz'd; 'tis past my memory,
But thus she told me: onely thus I know,
Since I could understand your honor'd Uncle
Since I could understand, your honor d Uncle
Hath given me all the liberal education,
That his own son might look for, had he one;
Now will he say, Dost thou requite me thus?
O! the thought kills me.

Viol. Gentle, gentle Gerrard,


Be cheer'd, and hope the best. My mother, father,
And uncle love me most indulgently,
Being the onely branch of all their stocks:
But neither they, nor he thou wouldst not grieve
With this unwelcom news, shall ever hear
Violanta's tongue reveal, much less accuse
Gerrard to be the father of his own;
I'll rather silent die, that thou maist live
To see thy little of-spring grow and thrive.

Enter Dorothea.

Dor. Mistris, away, your Lord and father seeks you;


I'll convey Gerrard out at the back door;
He has found a husband for you, and insults
In his invention, little thinking you
Have made your own choice, and possest him too.

Viol. A husband? 't mus[t] be Gerrard, or my death.


Fare well; be onely true unto thy self,
And know Heavens goodness shall prevented be,
Ere worthiest Gerrard suffer harm for me.

Ger. Fare well, my life and soul. Aunt, to your counsel


I flee for aid. O unexpressible love! thou art
An undigested heap of mixt extremes,
Whose pangs are wakings, and whose pleasures dreams.
[Exeunt.
Enter Benvoglio, Angelina, Ferdinand.
Ben. My Angelina, never didst thou yet
So please me, as in this consent; and yet
Thou hast pleas'd me well, I swear, old wench: ha, ha.
Ferdinand, she's thine own; thou'st have her, boy,
Ask thy good Lady else.

Ferd. Whom shall I have, Sir?

Ben. Whom d' ye think, ifaith?

Angel. Ghess.

Ferd. Noble Madam,


I may hope (prompted by shallow merit)
Through your profound grace, for your chamber-maid.

Ben. How 's that? how 's that?

[Ferd. Her chamber-maid, my Lord.


Ben.] Her chamber-pot, my Lord. You modest ass,
Thou never shew'dst thy self an ass till now.
'Fore Heaven I am angrie with thee. Sirha, sirha,
This whitmeat spirit's not yours, legitimate,
Advance your hope, and 't please you: ghess again.

Ang. And let your thoughts flee higher: aim them right;
Sir, you may hit, you have the fairest white.

Ferd. If I may be so bold then, my good Lord,


Your favour doth encourage me to aspire
To catch my Ladyes Gentlewoman.

Ben. Where?
Where would you catch her?
Do you know my daughter Violanta, Sir?

Ang. Well said: no more about the bush.

Ferd. My good Lord,


I have gaz'd on Violanta, and the stars,
Whose Heavenly influence I admir'd, not knew,
Nor ever was so sinful to believe
I might attain 't.

Ben. Now you are an ass again;


For if thou ne'er attain'st, 't is onely long
Of that faint heart of thine, which never did it.
She is your Lords heir, mine, Benvoglio's heir,
My brothers too, Randulpho's; her descent
Not behinde any of the Millanois.
And Ferdinand, although thy parentage
Be unknown, thou know'st that I have bred thee up
From five yeers old, and (do not blush to hear it)
Have found thy wisdom, trust, and fair success
So full in all my affa[ir]s, that I am fitter
To call thee Master, then thou me thy Lord.
Thou canst not be but sprung of gentlest blood;
Thy minde shines thorow thee, like the radiant sun,
Although thy body be a beauteous cloud.
Come, seriously this is no flatterie,
And well thou know'st it, though thy modest blood
Rise like the morning in thy cheek to hear 't.
Sir, I can speak in earnest: Vertuous service,
So meritorious, Ferdinand, as yours,
(Yet bashful still, and silent?) should extract
A fuller price then impudence exact:
And this is now the wages it must have;
My daughter is thy wife, my wealth thy slave.

Ferd. Good Madam pinch; I sleep: does my Lord mock,


And you assist? Custom's inverted quite;
For old men now adays do flout the young.

Ben. Fetch Violanta. As I intend this


Religiously, let my soul finde joy or pain. [Exit Angelina.

Ferd. My honor'd Lord and Master, if I hold


That worth could merit such felicitie,
You bred it in me, and first purchas'd it;
It is your own: and what productions
In all my faculties my soul begets,
Your very mark is on: you need not add
Rewards to him, that is in [d]ebt to you:
You sav'd my life, Sir, in the Massacre;
There you begot me new, since foster'd me.
O! can I serve to[o] much, or pray for you?
Alas, 'tis slender paiment to your bountie.
Your daughter is a paradice, and I
Unworthie to be set there; you may chuse
The royalst seeds of Milain.

Ben. Prethee peace,


e et ee peace,
Thy goodness makes me weep; I am resolv'd:
I am no Lord o' th' time, to tie my blood
To sordid muck; I have enough: my name,
My [s]tate and honors I will store in thee,
Whose wisdom will rule well, keep and increase:
A knave or fool, that could confer the like,
Would bate each hour, diminish every day.
Thou art her price-lot th[e]n, drawn out by fate;
An honest wise man is a Princes mate.

Ferd. Sir, Heaven and you have over-charg'd my brest


With grace beyond my continence; I shall burst:
The blessing you have given me (witness Saints)
I would not change for Millain. But, my Lord,
Is she prepar'd?

Ben. What needs Preparative,


Where such a Cordial is prescrib'd as thou?
Thy person and thy virtues in one scale,
Shall poize hers, with her beautie and her wealth;
If not, I add my will unto thy weight;
Thy mother's with her now. Son, take my keys,
And let this prepar[a]tion for this Marriage,
(This welcome Marriage) long determin'd here,
Be quick, and gorgeous.—Gerrard.

Enter Gerrard.
Ger. My good Lord,
My Lord, your brother craves your conference
Instantly, on affairs of high import.

Ben. Why, what news?

Ger. The Tyrant, my good Lord,


Is sick to death of his old Apoplexie,
Whereon the States advise, that Letters-missive
Be straight dispatcht to all the neighbour-Countreys,
And Schedules too divulg'd on every post,
To enquire the lost Duke forth: their purpose is
To re-instate him.

Ben. 'Tis a pious deed.


Ferdinand, to my daughter: this delay
(Though to so good a purpose) angers me;
But I'll recover it. Be secret, son.
Go woo with truth and expedition. [Exit.

Ferd. O my unsounded joy! how fares my Gerrard,


My noble twin-friend? fie, thy l[oo]k is heavie,
Sullen, and sowre; blanch it: didst thou know
My cause of joy, thou 'ldst never sorrow more,
I know thou lov'st me so, How dost thou?

Ger. Well,
Too well: my fraught of health my sickness is;
In life, I am dead; by living dying still.

Ferd. What sublunary mischief can predominate


A wise man thus? or doth thy friendship play
(In this antipathous extreme) with mine,
Lest gladness suffocate me? I, I, I do feel
My spirit's turn'd to fire, my blood to air,
And I am like a purifi'd essence
Tri'd from all drossie parts.

Ger. Were 't but my life,


The loss were sacrific'd; but virtue
Must for me be slain, and innocence made dust.

Ferd. Fare well good Gerrard.

Ger. Dearest friend, stay.

Ferd. Sad thoughts are no companions for me now,


Much less sad words: thy bosom bindes some secret,
Which do not trust me with; for mine retains
Another, which I must conceal from thee.

Ger. I would reveal it: 't is a heavie tale:


Canst thou be true, and secret still?

Ferd. Why, friend?


If you continue true unto your self,
I have no means of falshood. Lock this door;
Come, yet your prisoner's sure.

Ger. Stay, Ferdinand.

Ferd. What is this trouble? Love?


Why, thou art capable of any woman.
Doth want oppress thee? I will lighten thee:
Hast thou offended law? My Lord and thine,
And I, will save thy life. Does servitude
Upbraid thy freedom, that she suffers it?
Have patience but three days, and I will make thee
Thy Lords companion. Can a friend do more?

Ger. Lend me the means. How can this be?

Ferd. First let this Cabinet keep your pawn, and I will trust:
Yet for the form of satisfaction,
et o t e o o sat s act o ,
Take this my Oath to boot. By my presum'd
Gentrie, and sacred known Christianitie,
I'll die, ere I reveal thy trust.

Ger. Then hear it.


Your Lords fair daughter Violanta is
My betrothed wife, goes great with childe by me;
And by this deed both made a pr[e]y to Law.
How may I save her life? advise me, friend.

Ferd. What did he say? Gerrard, whose voice was that?


O death unto my heart, bane to my soul!
My wealth is vanish'd like the rich mans store:
In one poor minute all my daintie fare
But jugling dishes; my fat hope, despair.

Ger. Is this so odious? where's your mirth?

Ferd. Why thou


Hast robb'd me of it. Gerrard, draw thy sword;
And if thou lov'st my Mistris chastitie,
Defend it, else I'll cut it from thy heart,
Thy theevish heart that stole it, and restore 't,
Do miracles to gain her.

Ger. Was she thine?

Ferd. Never, but in my wish, and her fathers vow,


Which now he left with me, on such sure terms;
He call'd me son, and will'd me to provide
My Wedding-preparation.

Ger. Strange.

Ferd. Come, let's


Kill one another quickly.

G F di d l i ld t h thi b t
Ger. Ferdinand, my love is old to her, thine new begot:
I have not wrong'd thee; think upon thine Oath.

Ferd. It manacles me, Gerrard, else this hand


Should bear thee to the Law. Fare well for ever:
Since friendship is so fatal, never more
Will I have friend: thou hast put so sure a plea,
That all my weal's litigious made by thee.

Ger. I did no crime to you. His love transports him;


And yet I mourn, that cruel destinie
Should make us two thus one anothers cross:
We have lov'd since boys; for the same time cast him
On Lord Benvoglio, that my Aunt and I
Were succour'd by Randulpho: men have call'd us
The parallels of Millain; and some said
We were not much unlike. O Heaven divert,
That we should (ever since that time) be breeding
Mutual destruction.

Enter Dorothea.
Dor. O where are you? you have made a fair hand. By —— yonder is
your Aunt with my Lady; she came in, just as she was wooing your
Mistris for another; and what did me she, but out with her purse,
and shew'd all the naked truth, ifaith. Fie upon you, you should
never trust an old woman with a secret; they cannot hold; they
cannot hold so well as we, and you'ld hang 'em. First, there was
swearing and staring, then there was howling and weeping, and O
my daughter, and O my mother.
Ger. The effect, the effect.

Dor. Marry no way, but one with you.

Ger. Why welcom. Shall she scape?

Dor. Nay, she has made her scape already.

Ger. Why, is she gone?

Dor. The scape of her virginitie, I mean.


You men are as dull, you can conceive nothing;
You think it is enough to beget.

Ger. I; but surely, Dorothea, that scap'd not;


Her maiden-head suffer'd.

Dor. And you were the Executioner.

Ger. But what's the event? lord, how thou starv'st me, Doll!

Dor. Lord how thou starv'st me, Doll? By —— I would fain see you
cry a little. Do you stand now, as if you could get a child? Come, I'll
rack you no more: This is the heart of the business: always
provided, Signior, that if it please the fates to make you a Lord, you
be not proud, nor forget your poor handmaid Doll, who was partly
accessary to the incision of this Holofernian Maidenhead.
Ger. I will forget my name first. Speak.
Dor. Then thus; My Lady knows all; her sorrow is reasonably well
digested; has vow'd to conceal it from my Lord, till delay ripen things
better; Wills you to attend her this evening at the back gate; I'll let
you in; where her own Confessor shall put you together lawfully, e'r
the child be born; which birth is very near, I can assure you: all your
charge is your vigilance; and to bring with you some trusty Nurse, to
convey the Infant out of the house.
Ger. Oh beam of comfort, take! go, tell my Lady
I pray for her as I walk: my joys so flow,
That what I speak or do, I do not know.
[Exeunt.
Dumb Shew.
Enter Violanta at one door, we[e]ping, supported by
Cornelia and a Frier; at another door, Angelina
weeping, attended by Dorothea. Violanta kneels
down for pardon. Angelina shewing remorse, takes
her up, and cheers her; so doth Cornelia. Angelina
sends Dorothea for Gerrard. Enter Gerrard with
Dorothea: Angelina and Cornelia seem to chide
him, shewing Violanta's heavy plight: Violanta
rejoyceth in him: he makes signes of sorrow,
intreating pardon: Angelina brings Gerrard and
Violanta to the Frier; he joyns them hand in hand,
takes a Ring from Gerrard, puts it on Violanta's
finger; blesseth them; Gerrard kisseth her: the Frier
takes his leave. Violanta makes shew of great pain,
is instantly conveyed in by the Women, Gerrard is
bid stay; he walks in meditation, seeming to pray.
Enter Dorothea, whispers him, sends him out.
Enter Gerrard with a Nurse blindfold; gives her a
purse. To them Enter Angelina and Cornelia with an
Infant; they present it to Gerrard; he kisseth and
blesseth it; puts it into the Nurses arms, kneels,
and takes his leave. Exeunt all severally.
Enter Benvoglio and Randulpho.
Ben. He's dead, you say then.

Rand. Certainly: and to hear


The people now dissect him now he's gone,
Makes my ears burn, that lov'd him not: such Libels,
Such Elegies and Epigrams they have made,
More odious than he was. Brother, great men
Had need to live by love, meting their deeds
With virtues rule; sound, with the weight of judgement,
Their privat'st action: for though while they live
Their power and policie masque their villanies,
Their bribes, their lust, pride, and ambition,
And make a many slaves to worship 'em,
That are their flatterers, and their bawds in these:
These very slaves shall, when these great beasts dye,
Publish their bowels to the vulgar eye.

Ben. 'Fore Heaven 'tis true. But is Rinaldo (brother) our good Duke,
heard of living?

Rand. Living, Sir, and will be shortly with the Senate: has
Been close conceal'd at Mantua, and reliev'd:
But what's become of his? no tidings yet?
But brother, till our good Duke shall arrive,
Carry this news, here. Where's your Ferdinand?

Ben. Oh busie, Sir, about this marriage:


And yet my Girl o'th' suddain is fall'n sick:
You'll see her e'r you go?

Rand. Yes; well I love her;


And yet I wish I had another daughter
To gratifie my Gerrard, who (by ——)
Is all the glory of my family,
But has too much worth to [l]ive so obscure;
I'll have him Secretary of Estate
Upon the Dukes return: for credit me,
The value of that Gentleman's not known;
His strong abilities are fit to guide
The whole Republique: he hath Learning, youth,
Valour, discretion, honesty of a Saint;
His Aunt is wondrous good too.

Enter Violanta in a bed; Angelina and


Dorothea sitting by her.
Ben. You have spoke
The very character of Ferdinand:
One is the others mirror. How now, Daughter?

Rand. How fares my Neece?

Viol. A little better, Uncle, then I was,


I thank you.

Rand. Brother, a meer cold.

Angel. It was a cold and heat, I think: but Heaven be thanked


We have broken that away.

Ben. And yet, Violanta,


You'll lie alone still, and you see what's got.

Dor. Sure, Sir, when this was got, she had a bed-fellow.

Rand. What has her chollick left her in her belly?

Dor. 'T has left her, but she has had a sore fit.

Rand. I, that same Collick and Stone's inherent to us


O' th' womans side: our Mothers had them both.

Dor. So has she had, Sir. How these old fornicators talk! she had
more
Need of Mace-Ale, and Rhenish-wine Caudles, heaven knows,
Then your aged Discipline.

Ben. Say?

Enter Ferdinand.
Ang. She will have the man; and on recovery
Will wholly be dispos'd by you.

Ben. That's my wench:


How now? what change is this? why Ferdinand,
Are these your Robes of joy should be indu'd?
Doth Hymen wear black? I did send for you
To have my honorable Brother witness
The Contract I will make 'twixt you and her.
Put off all doubt; she loves ye? what d' ye say?

Rand. Speak man, Why look you so distractedly?

Ferd. There are your keys, [Sir:] I'll no Contract[s, I]


Divinest V[i]olanta, I will serve you
Thus on my knees, and pray for you: Juno, Lucina fer opem.
My inequality ascends no higher:
I dare not marry you.

Ben. How's this?

Ferd. Good night,


I have a friend has almost made me mad:
I weep sometimes, and instantly can laugh:
Nay, I do dance, and sing, and suddenly
Roar like a storm. Strange tricks these, are they not?
And wherefore all this? Shall I tell you? no,
Thorow mine ears, my heart a plague hath caught,
And I have vow'd to keep it close, not shew
My grief to any; for it has no cure.
On, wandring steps, to some remote place move:
I'll keep my vow, though I have lost my Love. [Exit.

Ben. 'Fore heaven, distracted for her! fare you well:


I'll watch his steps; for I no joy shall find,
Till I have found his cause, and calm'd his mind.
[Exit.
[Rand.] He's overcome with joy.

Ang[e]l. 'Tis very strange.

Rand. Well, Sister, I must leave you; the time's busie.


Violanta, chear you up; and I pray Heaven
Restore each to their love, and health again. [Exit.

Viol. Amen, Great Uncle. Mother, what a chance


Unluckily is added to my woe,
In this young Gentleman!

Ang[e]l. True, Violanta:


It grieves me much. Doll, go you instantly,
And find out Gerrard; tell him his friends hap,
And let him use best means to comfort him;
But as his life preserve this secret still.

Viol. Mother, I'ld not offend you: might not Gerrard


Steal in, and see me in the evening?

Angel. Well,
Bid him do so.

Viol. Heavens blessing o' your heart.


Do ye not call Child-bearing, Travel, Mother?

Angel. Yes.

Viol. It well may be, The bare-foot traveller


That's born a Prince, and walks his pilgrimage,
Whose tender feet kiss the remorseless stones
Only, ne'er felt a travel like to it.
Alas, dear Mother, you groan'd thus for me,
And yet how disobedient have I been!

Angel. Peace, Violanta, thou hast always been


Gentle and good.

Viol. Gerrard is better, Mother:


Oh if you knew the implicite innocency
Dwells in his brest, you'ld love him like your Prayers.
I see no reason but my Father might
Be told the truth, being pleas'd for Ferdinand
To wooe himself: and Gerard ever was
His full comparative: my Uncle loves him,
As he loves Ferdinand.

Angel. No, not for the world,


Since his intent is cross'd: lov'd Ferdinand
Thus ruin'd, and a child got out of wedlock:
His madness would pursue ye both to death.

Viol. As you please (mother:) I am now, methinks,


Even in the land of ease; I'll sleep.

Angel. Draw in
The bed nearer the fire: silken rest,
Tie all thy cares up. [Exeunt.

Enter Ferdinand and Benvoglio privately


after him.
Ferd. Oh blessed solitude! here my grief[s] may speak;
And sorrow, I will argue with thee now:
Nothing will keep me company: the flowers
Die at my moan; the gliding silver streams
Hasten to flee my lamentations;
The air rolls from 'em; and the Golden Sun
Is smother'd pale as Phœbe with my sighs:
Only the earth is kind, that stays. Then earth,
To thee will I complain. Why do the Heavens
Impose upon me Love, what I can ne'er enjoy?
Before fruition was impossible,
I did not thirst it. Gerrard, she is thine,
Seal'd and deliver'd; but 'twas ill to stain
Her virgin state, e'r ye were married.
Poor Infant, what's become of thee? thou know'st not
The woe thy parents brought thee t[o]. Dear earth,
Bury this close in thy sterility;
Be barren to this seed, let it not grow;
For if it do, 'twill bud no Violet
Nor Gillyflower, but wild Brier, or rank Rue,
Unsavory and hurtful.

Ben. Ferdinand,
Thy steel hath digg'd the Earth, thy words my Heart.

Ferd. Oh! I have violated faith, betraid


My friend and innocency.

Ben. Desperate youth,


Violate not thy soul too: I have showers
For thee, young man; but Gerrard flames for thee.
Was thy base pen made to dash out mine honor,
And prostitute my Daughter? Bastard, whore,
Come, turn thy femal tears into revenge,
Which I will quench my thirst with, e'r I see
Daughter or Wife or branded Family
Daughter, or Wife, or branded Family.
By —— both dye: and for amends,
Ferd'nando be my heir. I'll to my brother,
First tell him all, then to the Duke for justice:
This morning he's receiv'd. Mountains nor Seas
Shall bar my flight to vengeance: the foul stain
Printed on me, thy bloud shall rinse again. [Exit.

Ferd. I have transgress'd all goodness, witlesly


Rais'd mine own curs[es] from posterity:
I'll follow, to redress in what I may;
If not, your heir can dye as well as they. [Exit.

Dumb Shew.
Enter Duke Rinaldo with Attendants, at one door;
States, Randulpho, and Gerrard, at another: they
kneel to the Duke, he accepts their obedience, and
raises them up: they prefer Gerrard to the Duke,
who entertains him: they seat the Duke in State.
Enter Benvoglio and Ferdinand: Benvoglio kneels
for justice; Ferd. seems to restrein him. Benvog.
gives the Duke a paper; Duke reads, frowns on
Gerr. shews the paper to the States, they seem
sorry, consult, cause the Guard to apprehend him;
they go off with him. Then Rand. and Benv. seem
to crave justice; Duke vows it, and exit with his
attendants. Rand. Ben. and Ferd. confer. Enter to
them Cornelia with two servants; she seems to
expostulate, Rand. in scorn, causeth her to be
thrust out poorly. Exit Rand. Benv. beckons Ferd. to
him (with much seeming passion) swears him; then
stamps with his foot. Enter Dorothea with a Cup,
weeping, she delivers it to Ferd. who with
discontent exit; and exeunt Benvoglio and
Dorothea.
Enter Violanta.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookmass.com

You might also like