Meichael_Margolis_-_Arduino_Cookbook.pdf
(
19660 KB
)
Pobierz
SECOND EDITION
Arduino Cookbook
Michael Margolis
Beijing
Cambridge
Farnham
Köln
Sebastopol
Tokyo
•
•
•
•
•
Arduino Cookbook, Second Edition
by Michael Margolis
Copyright © 2012 Michael Margolis, Nicholas Weldin. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly 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 our
corporate/institutional sales department: (800) 998-9938 or
corporate@oreilly.com
.
Editors:
Shawn Wallace and Brian Jepson
Production Editor:
Teresa Elsey
Proofreader:
Kiel Van Horn
Indexer:
Lucie Haskins
Cover Designer:
Karen Montgomery
Interior Designer:
David Futato
Illustrator:
Robert Romano
March 2011:
First Edition.
December 2011:
Second Edition.
Revision History for the Second Edition:
2011-12-09 First release
See
http://oreilly.com/catalog/errata.csp?isbn=9781449313876
for release details.
Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of
O’Reilly Media, Inc.
Arduino Cookbook
, the image of a toy rabbit, and related trade dress are trademarks
of O’Reilly 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 O’Reilly 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 authors assume
no responsibility for errors or omissions, or for damages resulting from the use of the information con-
tained herein.
ISBN: 978-1-449-31387-6
[LSI]
1323465788
Table of Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
1.
Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Installing the Integrated Development Environment (IDE)
4
1.2 Setting Up the Arduino Board
8
1.3 Using the Integrated Development Environment (IDE) to Prepare
an Arduino Sketch
10
1.4 Uploading and Running the Blink Sketch
13
1.5 Creating and Saving a Sketch
14
1.6 Using Arduino
17
2.
Making the Sketch Do Your Bidding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.1 Structuring an Arduino Program
24
2.2 Using Simple Primitive Types (Variables)
25
2.3 Using Floating-Point Numbers
27
2.4 Working with Groups of Values
29
2.5 Using Arduino String Functionality
32
2.6 Using C Character Strings
37
2.7 Splitting Comma-Separated Text into Groups
38
2.8 Converting a Number to a String
41
2.9 Converting a String to a Number
43
2.10 Structuring Your Code into Functional Blocks
45
2.11 Returning More Than One Value from a Function
49
2.12 Taking Actions Based on Conditions
52
2.13 Repeating a Sequence of Statements
53
2.14 Repeating Statements with a Counter
55
2.15 Breaking Out of Loops
58
2.16 Taking a Variety of Actions Based on a Single Variable
59
2.17 Comparing Character and Numeric Values
61
2.18 Comparing Strings
63
2.19 Performing Logical Comparisons
64
iii
Plik z chomika:
loran_raul
Inne pliki z tego folderu:
Arduino and Kinect Projects.pdf
(80744 KB)
Arduino Adventures V413HAV(1).pdf
(16174 KB)
Arduino Robotics.pdf
(21460 KB)
Electronic Circuits for the Evil Genius(1).pdf
(80612 KB)
Jack_Purdum_-_Beginning_C_for_Arduino.pdf
(28168 KB)
Inne foldery tego chomika:
books pdf
Dokumenty
Ebooks Downloads
electronics pdf
Galeria
Zgłoś jeśli
naruszono regulamin