Table of Contents
Title Page
Copyright
Dedication
About the Author
About the Technical Editor
Credits
Acknowledgments
Introduction
Overview of the Book and Technology
How This Book Is Organized
Who Should Read This Book
Tools You Need
What's on the Website
Summary
Part I: Introduction to Arduino
Chapter 1: Introduction to Arduino
Atmel AVR
The Arduino Project
The ATmega Series
The Different Arduinos
Shields
What Can You Do with an Arduino?
What You Will Need for This Book
Summary
Chapter 2: Programming for the Arduino
Installing Your Environment
Your First Program
Understanding Your First Sketch
Programming Basics
Summary
Chapter 3: Electronics Basics
Electronics 101
Voltage, Amperage, and Resistance
The Basic Components
Breadboards
Inputs and Outputs
Connecting a Light-Emitting Diode
Summary
Part II: Standard Libraries
Chapter 4: The Arduino Language
I/O Functions
Time Functions
Mathematical Functions
Trigonometry
Interrupts
Summary
Chapter 5: Serial Communication
Introducing Serial Communication
UART Communications
Debugging and Output
Starting a Serial Connection
Writing Data
Reading Data
Example Program
SoftwareSerial
Summary
Chapter 6: EEPROM
Introducing EEPROM
The Different Memories on Arduino
The EEPROM Library
Preparing EEPROM Storage
Adding Nonvolatile Memory
Summary
Chapter 7: SPI
Introducting SPI
SPI Bus
Arduino SPI
SPI Library
SPI on the Arduino Due
Example Program
Summary
Chapter 8: Wire
Introducing Wire
Connecting I
2
C
I
2
C Protocol
Communicating
Traps and Pitfalls
Summary
Chapter 9: Ethernet
Introduction
Ethernet
TCP/IP
Ethernet on Arduino
Arduino as a Client
Summary
Chapter 10: WiFi
Introduction
The WiFi Protocol
Arduino WiFi
Example Application
Summary
Chapter 11: LiquidCrystal
Introduction
LiquidCrystal Library
Example Program
Summary
Chapter 12: SD
Introduction
SD Cards
Using SD Cards with Arduino
The SD Library
Example Program and Sketch
Summary
Chapter 13: TFT
Introduction
Technologies
TFT Library
Example Application
Summary
Chapter 14: Servo
Introduction to Servo Motors
Controlling Servo Motors
Example Application
Summary
Chapter 15: Stepper
Introducing Motors
Controlling a Stepper Motor
The Stepper Library
Example Project
Summary
Chapter 16: Firmata
Introducing Firmata
Firmata Library
Example Program
Summary
Chapter 17: GSM
Introducing GSM
Mobile Data Network
Arduino and GSM
Arduino GSM Library
Example Application
Summary
Part III: Device-Specifi c Libraries
Chapter 18: Audio
Introducing Audio
Digital Sound Files
Music on the Arduino
Arduino Due
Example Program
Summary
Chapter 19: Scheduler
Introducing Scheduling
Arduino Multitasking
Scheduler
Example Program
Summary
Chapter 20: USBHost
Introducing USBHost
USB Protocol
USB Devices
Arduino Due
USBHost Library
Example Program
Summary
Chapter 21: Esplora
Introducing Esplora
The Arduino Esplora Library
Example Program and Exercises
Summary
Chapter 22: Robot
Introducing Robot Library
Arduino Robot
Robot Library
Example Program and Exercises
Summary
Chapter 23: Bridge
Introducing Bridge Library
Bridge
Example Application
Summary
Part IV: User Libraries and Shields
Chapter 24: Importing Third-Party Libraries
Libraries
Example Application
Exercises
Summary
Chapter 25: Creating Your Own Shield
Creating a Shield
Your First Shield
Summary
Chapter 26: Creating Your Own Library
Libraries
Example Library
Summary
End User License Agreement
Pages
v
vii
ix
xi
xiii
xiii
xiv
xxix
xxx
xxxi
xxxii
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
241
242
243
244
245
246
247
248
249
250
251
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
377
378
379
380
381
382
383
384
385
386
387
388
389
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
Guide
Cover
Table of Contents
Introduction
Part I: Introduction to Arduino
Begin Reading
List of Illustrations
Figure 1.1
Figure 1.2
Figure 1.3
Figure 1.4
Figure 1.5
Figure 1.6
Figure 1.7
Figure 1.8
Figure 1.9
Figure 1.10
Figure 1.11
Figure 1.12
Figure 1.13
Figure 1.14
Figure 2.1
Figure 2.2
Figure 2.3
Figure 2.4
Figure 2.5
Figure 3.1
Figure 3.2
Figure 3.3
Figure 3.4
Figure 3.5
Figure 3.6
Figure 3.7
Figure 3.8
Figure 4.1
Figure 5.1
Figure 5.2
Figure 5.3
Figure 5.4
Figure 6.1
Figure 6.2
Figure 6.3
Figure 6.4
Figure 7.1
Figure 7.2
Figure 7.3
Figure 8.1
Figure 8.2
Figure 8.3
Figure 8.4
Figure 8.5
Figure 9.1
Figure 10.1
Figure 10.2
Figure 10.3
Figure 11.1
Figure 11.2
Figure 11.3
Figure 11.4
Figure 12.1
Figure 12.2
Figure 12.3
Figure 12.4
Figure 12.5
Figure 12.6
Figure 12.7
Figure 13.1
Figure 13.2
Figure 14.1
Figure 14.2
Figure 14.3
Figure 15.1
Figure 15.2
Figure 17.1
Figure 18.1
Figure 18.2
Figure 18.3
Figure 19.1
Figure 19.2
Figure 19.3
Figure 19.4
Figure 20.1
Figure 20.2
Figure 20.3
Figure 22.1
Figure 23.1
Figure 24.1
Figure 24.2
Figure 24.3
Figure 24.4
Figure 24.5
Figure 24.6
Figure 25.1
Figure 25.2
Figure 25.3
Figure 25.4
Figure 25.5
Figure 25.6
Figure 25.7
Figure 26.1
Figure 26.2
Figure 26.3
List of Tables
Table 2.1
Table 3.1
Table 4.1
Table 7.1
Table 7.2
Table 7.3
Table 8.1
Table 8.2
Table 9.1
Table 10.1
Table 10.2
Table 16.1
Table 16.2
Table 17.1
Table 20.1
Table 22.1
Table 22.2
Table 22.3