An up-to-date Arduino programming guide—no prior programming experience required!
This fully updated guide shows, step by step, how to quickly and easily program all Arduino models using its modified C language and the Arduino IDE. Electronics guru Simon Monk gets you up to speed quickly, teaching all concepts through simple language and clear instruction. Programming Arduino®: Getting Started with Sketches, Third Edition features dozens of easy-to-follow examples and high-quality illustrations. All of the sample sketches featured in the book can be used as is or modified to suit your needs. You will also get all new coverage of using Arduino as a framework for programming other popular boards.
- Configure your Arduino and start writing sketches
- Understand the basics of C language and the Arduino IDE
- Add functions, arrays, and strings to your sketches
- Set up Arduino’s digital and analog I/O
- Use Arduino-compatible boards including ESP32, Pico, and micro:bit
- Work with built-in and custom Arduino libraries
- Write sketches that store data in EPROM or flash memory
- Interface with a wide range of displays, including LCDs
- Connect to the Internet and configure Arduino as a web server
- Develop interesting and useful programs for the Internet of Things
Preface |
|
xi | |
Acknowledgments |
|
xiii | |
Introduction |
|
xv | |
|
|
1 | (16) |
|
|
1 | (2) |
|
|
2 | (1) |
|
A Tour of an Arduino Uno Board |
|
|
3 | (4) |
|
|
4 | (1) |
|
|
4 | (1) |
|
|
4 | (1) |
|
|
4 | (1) |
|
|
5 | (1) |
|
|
5 | (1) |
|
A Tour of a WiFi-Capable Arduino-Compatible |
|
|
6 | (1) |
|
|
7 | (1) |
|
|
8 | (1) |
|
|
8 | (2) |
|
Uploading Your First Sketch |
|
|
10 | (4) |
|
|
14 | (2) |
|
|
16 | (1) |
|
|
17 | (22) |
|
|
17 | (2) |
|
What Is a Programming Language? |
|
|
19 | (5) |
|
|
24 | (2) |
|
|
26 | (1) |
|
|
27 | (4) |
|
Numeric Variables and Arithmetic |
|
|
29 | (2) |
|
|
31 | (6) |
|
|
31 | (2) |
|
|
33 | (3) |
|
|
36 | (1) |
|
|
37 | (1) |
|
|
37 | (2) |
|
|
39 | (14) |
|
|
39 | (1) |
|
|
40 | (1) |
|
Global, Local, and Static Variables |
|
|
41 | (3) |
|
|
44 | (1) |
|
|
45 | (4) |
|
|
45 | (1) |
|
|
46 | (1) |
|
|
47 | (2) |
|
|
49 | (3) |
|
|
49 | (1) |
|
|
50 | (1) |
|
|
50 | (1) |
|
|
51 | (1) |
|
|
52 | (1) |
|
|
53 | (16) |
|
|
53 | (4) |
|
Morse Code SOS Using Arrays |
|
|
56 | (1) |
|
|
57 | (2) |
|
|
57 | (2) |
|
|
59 | (1) |
|
|
59 | (8) |
|
|
60 | (1) |
|
|
61 | (1) |
|
|
62 | (2) |
|
The flashSequence Function |
|
|
64 | (1) |
|
The flashDotOrDash Function |
|
|
65 | (1) |
|
|
66 | (1) |
|
|
67 | (1) |
|
|
67 | (2) |
|
|
69 | (18) |
|
|
69 | (4) |
|
|
72 | (1) |
|
|
73 | (9) |
|
|
73 | (3) |
|
Internal Pull-Up Resistors |
|
|
76 | (1) |
|
|
77 | (5) |
|
|
82 | (2) |
|
|
84 | (2) |
|
|
86 | (1) |
|
|
87 | (14) |
|
|
87 | (2) |
|
|
89 | (1) |
|
|
90 | (1) |
|
|
91 | (1) |
|
|
92 | (3) |
|
|
95 | (1) |
|
|
96 | (2) |
|
|
98 | (1) |
|
|
99 | (2) |
|
|
101 | (12) |
|
|
101 | (3) |
|
|
104 | (1) |
|
|
104 | (2) |
|
|
106 | (2) |
|
|
106 | (2) |
|
|
108 | (1) |
|
|
108 | (4) |
|
|
110 | (1) |
|
|
111 | (1) |
|
|
112 | (1) |
|
|
113 | (12) |
|
|
113 | (1) |
|
Storing Data in Flash Memory |
|
|
114 | (2) |
|
|
116 | (7) |
|
|
117 | (2) |
|
Writing Anything to Eeprom |
|
|
119 | (1) |
|
Storing a float in Eeprom |
|
|
120 | (1) |
|
Storing a String in Eeprom |
|
|
121 | (1) |
|
Clearing the Contents of Eeprom |
|
|
122 | (1) |
|
|
123 | (1) |
|
|
123 | (1) |
|
|
124 | (1) |
|
|
125 | (10) |
|
Alphanumeric LCD Displays |
|
|
126 | (1) |
|
|
127 | (2) |
|
|
129 | (1) |
|
Other LCD Library Functions |
|
|
130 | (1) |
|
|
130 | (1) |
|
Connecting an OLED Display |
|
|
131 | (1) |
|
|
132 | (2) |
|
|
134 | (1) |
|
10 Arduino Internet of Things Programming |
|
|
135 | (20) |
|
|
135 | (1) |
|
Installing ESP32 into the Arduino IDE |
|
|
136 | (1) |
|
|
137 | (2) |
|
|
139 | (2) |
|
|
141 | (1) |
|
Serving Sensor Readings---Improved |
|
|
142 | (4) |
|
Turning the Built-in LED On and Off from a Web Page |
|
|
146 | (1) |
|
Connecting to a Web Service |
|
|
147 | (6) |
|
|
153 | (2) |
Index |
|
155 | |
Simon Monk has a degree in cybernetics and computer science and a Ph.D. in software engineering. He is the author of numerous books, including Programming Arduino, 30 Arduino Projects for the Evil Genius; Hacking Electronics; and Make Your Own PCBs with Fritzing. Simon also runs the website monk.makes.com, which features his own products.