Preface |
|
ix | |
1 The ABCs of C |
|
1 | (20) |
|
|
2 | (1) |
|
|
2 | (17) |
|
|
2 | (13) |
|
Creating a C "Hello, World" |
|
|
15 | (2) |
|
|
17 | (1) |
|
|
17 | (2) |
|
|
19 | (2) |
2 Storing and Stating |
|
21 | (26) |
|
|
21 | (3) |
|
|
22 | (1) |
|
|
22 | (2) |
|
|
24 | (10) |
|
|
24 | (3) |
|
|
27 | (2) |
|
|
29 | (2) |
|
|
31 | (1) |
|
|
32 | (2) |
|
|
34 | (5) |
|
|
34 | (1) |
|
|
35 | (3) |
|
scanf() and Parsing Inputs |
|
|
38 | (1) |
|
Operators and Expressions |
|
|
39 | (6) |
|
|
39 | (2) |
|
|
41 | (1) |
|
|
42 | (3) |
|
|
45 | (2) |
3 Flow of Control |
|
47 | (34) |
|
|
47 | (5) |
|
|
48 | (1) |
|
|
49 | (3) |
|
|
52 | (11) |
|
|
52 | (6) |
|
|
58 | (5) |
|
The Ternary Operator and Conditional Assignment |
|
|
63 | (2) |
|
|
65 | (7) |
|
|
65 | (4) |
|
|
69 | (2) |
|
|
71 | (1) |
|
|
72 | (5) |
|
|
74 | (1) |
|
|
75 | (2) |
|
|
77 | (2) |
|
|
79 | (2) |
4 Bits and (Many) Bytes |
|
81 | (22) |
|
Storing Multiple Things with Arrays |
|
|
81 | (10) |
|
Creating and Manipulating Arrays |
|
|
82 | (6) |
|
|
88 | (1) |
|
|
89 | (1) |
|
Accessing Elements in Multidimensional Arrays |
|
|
90 | (1) |
|
|
91 | (6) |
|
Binary, Octal, Hexadecimal |
|
|
92 | (1) |
|
Octal and Hexadecimal Literals in C |
|
|
93 | (1) |
|
Input and Output of Octal and Hex Values |
|
|
94 | (2) |
|
|
96 | (1) |
|
|
97 | (4) |
|
|
101 | (1) |
|
|
102 | (1) |
5 Functions |
|
103 | (24) |
|
|
104 | (1) |
|
|
104 | (1) |
|
|
105 | (2) |
|
Sending Information to Functions |
|
|
107 | (4) |
|
|
107 | (1) |
|
Passing Strings to Functions |
|
|
108 | (2) |
|
|
110 | (1) |
|
|
110 | (1) |
|
|
111 | (3) |
|
|
112 | (1) |
|
|
113 | (1) |
|
Nested Calls and Recursion |
|
|
114 | (4) |
|
|
115 | (3) |
|
|
118 | (3) |
|
|
119 | (2) |
|
|
121 | (4) |
|
|
122 | (1) |
|
Command-Line Arguments and main() |
|
|
123 | (2) |
|
|
125 | (2) |
6 Pointers and References |
|
127 | (22) |
|
|
127 | (7) |
|
The NULL Value and Pointer Errors |
|
|
129 | (1) |
|
|
130 | (1) |
|
Local Variables and the Stack |
|
|
131 | (2) |
|
Global Variables and the Heap |
|
|
133 | (1) |
|
|
134 | (1) |
|
|
135 | (2) |
|
|
137 | (1) |
|
Managing Memory with Arrays |
|
|
138 | (2) |
|
|
138 | (1) |
|
|
139 | (1) |
|
|
140 | (5) |
|
|
141 | (1) |
|
Assigning and Accessing Structure Members |
|
|
141 | (1) |
|
|
142 | (1) |
|
|
143 | (2) |
|
|
145 | (2) |
|
|
147 | (2) |
7 Libraries |
|
149 | (16) |
|
|
150 | (11) |
|
|
150 | (1) |
|
|
150 | (4) |
|
|
154 | (3) |
|
|
157 | (2) |
|
|
159 | (1) |
|
|
160 | (1) |
|
|
161 | (2) |
|
|
161 | (1) |
|
|
162 | (1) |
|
|
163 | (1) |
|
|
164 | (1) |
8 Real-World C With Arduino |
|
165 | (24) |
|
Arduino IDE (Win, Mac, Linux) |
|
|
166 | (3) |
|
|
167 | (1) |
|
|
168 | (1) |
|
|
168 | (1) |
|
Your First Arduino Project |
|
|
169 | (7) |
|
|
170 | (2) |
|
|
172 | (3) |
|
|
175 | (1) |
|
|
176 | (3) |
|
|
177 | (1) |
|
|
178 | (1) |
|
|
179 | (8) |
|
C++ Objects and Variables |
|
|
182 | (1) |
|
More Practice with Objects |
|
|
183 | (2) |
|
|
185 | (1) |
|
|
186 | (1) |
|
|
187 | (2) |
9 Smaller Systems |
|
189 | (32) |
|
|
189 | (8) |
|
|
190 | (2) |
|
|
192 | (1) |
|
|
193 | (1) |
|
Trying Out the Arduino "Stuff" |
|
|
194 | (3) |
|
|
197 | (9) |
|
|
197 | (1) |
|
|
198 | (1) |
|
|
199 | (1) |
|
|
200 | (2) |
|
Buttons and Digital Input |
|
|
202 | (2) |
|
|
204 | (2) |
|
Memory Management on Arduino |
|
|
206 | (9) |
|
|
206 | (3) |
|
|
209 | (2) |
|
|
211 | (1) |
|
|
212 | (3) |
|
|
215 | (3) |
|
Interrupt Service Routines |
|
|
215 | (1) |
|
Interrupt-Driven Programming |
|
|
216 | (2) |
|
|
218 | (2) |
|
|
220 | (1) |
10 Faster Code |
|
221 | (14) |
|
|
222 | (1) |
|
Floating-Point Versus Integer Math |
|
|
223 | (6) |
|
Floating-Point Math Alternatives |
|
|
224 | (1) |
|
Integer Math Versus No Math |
|
|
225 | (1) |
|
|
226 | (1) |
|
|
227 | (2) |
|
|
229 | (1) |
|
|
230 | (2) |
|
Unrolling for Fun and Profit |
|
|
231 | (1) |
|
Recursion Versus Iteration |
|
|
232 | (1) |
|
|
232 | (1) |
|
|
233 | (1) |
|
|
234 | (1) |
11 Custom Libraries |
|
235 | (32) |
|
Creating Your Own Library |
|
|
235 | (9) |
|
|
238 | (1) |
|
|
239 | (1) |
|
|
240 | (1) |
|
|
241 | (3) |
|
|
244 | (5) |
|
|
244 | (3) |
|
|
247 | (2) |
|
Importing Custom Libraries |
|
|
249 | (16) |
|
Facilitating Communication |
|
|
249 | (1) |
|
|
250 | (2) |
|
|
252 | (1) |
|
|
253 | (6) |
|
|
259 | (1) |
|
|
260 | (2) |
|
|
262 | (1) |
|
Documentation and Distribution |
|
|
262 | (3) |
|
|
265 | (2) |
12 Next Next Steps |
|
267 | (8) |
|
Intermediate and Advanced Topics |
|
|
267 | (6) |
|
|
268 | (5) |
|
|
273 | (1) |
|
|
273 | (1) |
|
|
274 | (1) |
|
|
274 | (1) |
A Hardware and Software |
|
275 | (6) |
B printf() Format Specifier Details |
|
281 | (4) |
Index |
|
285 | |