MAKE.BASIC.ARDUINO.PROJECTS.2014.pdf

(99269 KB) Pobierz
Make: Basic
Arduino
Projects
26 Experiments with Microcontrollers
and Electronics
Don Wilcher
Make: Basic Arduino Projects
by Don Wilcher
Copyright © 2014 Don Wilcher. All rights reserved.
Printed in the United States of America.
Published by Maker Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
Maker Media books may be purchased for educational, business, or sales promotional use.
Online editions are also available for most titles (http://my.safaribooksonline.com). For more
information, contact O’Reilly Media’s corporate/institutional sales department:
800-998-9938 or
corporate@oreilly.com.
Editor:
Patrick Di Justo
Production Editor:
Kara Ebrahim
Copyeditor:
Charles Roumeliotis
Proofreader:
Jasmine Kwityn
Indexer:
Ellen Troutman
Cover Designer:
Juliann Brown
Interior Designer:
David Futato
Illustrator:
Rebecca Demarest
Photographers:
Frank Teng and Don Wilcher
February 2014:
First Edition
Revision History for the First Edition:
2014-02-05:
2014-03-07:
First release
Second release
See
http://oreilly.com/catalog/errata.csp?isbn=9781449360665
for release details.
The Make logo and Maker Media logo are registered trademarks of Maker Media, Inc.
Make:
Basic Arduino Projects
and related trade dress are trademarks of Maker Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products
are claimed as trademarks. Where those designations appear in this book, and Maker Media,
Inc., was aware of a trademark claim, the designations have been printed in caps or initial
caps.
While every precaution has been taken in the preparation of this book, the publisher and
author assume no responsibility for errors or omissions, or for damages resulting from the
use of the information contained herein.
ISBN: 978-1-449-36066-5
[LSI]
Contents
Preface.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
1.
The Trick Switch.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Parts List.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Let’s Build a Trick Switch.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Trick Switch with On/Off Indicators.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Something to Think About.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.
Sunrise-Sunset Light Switch.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Parts List.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Let’s Build a Sunrise-Sunset Light Switch.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Circuit Theory.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Sunrise-Sunset Detector with Serial Monitor.
. . . . . . . . . . . . . . . . . . . . . . . . 14
Something to Think About.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.
Tilt Sensing Servo Motor Controller.
. . . . . . . . . . . . . . . . . . . . . . . . . 19
Parts List.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Let’s Build a Tilt Sensing Servo Motor Controller.
. . . . . . . . . . . . . . . . . . . . . 20
Upload the Tilt Sensor Sketch.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
A Simple Animatronic Controller Using the Serial Monitor.
. . . . . . . . . . . . 24
Circuit Theory.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Something to Think About.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.
Twin LEDs.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Parts List.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Circuit Theory.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
iii
Zgłoś jeśli naruszono regulamin