Muutke küpsiste eelistusi

E-raamat: Smaller C

  • Formaat: 314 pages
  • Ilmumisaeg: 27-May-2021
  • Kirjastus: O'Reilly Media
  • Keel: eng
  • ISBN-13: 9781098100308
  • Formaat - PDF+DRM
  • Hind: 40,37 €*
  • * hind on lõplik, st. muud allahindlused enam ei rakendu
  • Lisa ostukorvi
  • Lisa soovinimekirja
  • See e-raamat on mõeldud ainult isiklikuks kasutamiseks. E-raamatuid ei saa tagastada.
  • Formaat: 314 pages
  • Ilmumisaeg: 27-May-2021
  • Kirjastus: O'Reilly Media
  • Keel: eng
  • ISBN-13: 9781098100308

DRM piirangud

  • Kopeerimine (copy/paste):

    ei ole lubatud

  • Printimine:

    ei ole lubatud

  • Kasutamine:

    Digitaalõiguste kaitse (DRM)
    Kirjastus on väljastanud selle e-raamatu krüpteeritud kujul, mis tähendab, et selle lugemiseks peate installeerima spetsiaalse tarkvara. Samuti peate looma endale  Adobe ID Rohkem infot siin. E-raamatut saab lugeda 1 kasutaja ning alla laadida kuni 6'de seadmesse (kõik autoriseeritud sama Adobe ID-ga).

    Vajalik tarkvara
    Mobiilsetes seadmetes (telefon või tahvelarvuti) lugemiseks peate installeerima selle tasuta rakenduse: PocketBook Reader (iOS / Android)

    PC või Mac seadmes lugemiseks peate installima Adobe Digital Editionsi (Seeon tasuta rakendus spetsiaalselt e-raamatute lugemiseks. Seda ei tohi segamini ajada Adober Reader'iga, mis tõenäoliselt on juba teie arvutisse installeeritud )

    Seda e-raamatut ei saa lugeda Amazon Kindle's. 

For makers looking to use the smallest microcontrollers or to wring the highest performance out of larger ones, the C language is still the best option. This practical book provides a solid grounding in C basics for anyone who tinkers with programming microcontrollers. You'll explore the many ways C enables developers and makers to get big results out of tiny devices.

Author Marc Loy shows you how to write clean, maintainable C code from scratch. This language and its cousin, C++, are still widely used to write low-level code for device drivers or operating systems. By understanding C syntax and its quirks, you'll gain an enduring computer language literacy that will help you pick up new languages and styles more easily.

  • Learn C fundamentals including data types, flow control, and functions
  • Explore memory management including how programs work on small devices
  • Understand answers provided in online forums such as Reddit or Stack Overflow
  • Write efficient, custom C code that's both readable and maintainable
  • Analyze the performance of your code and weigh optimizations
  • Evaluate third-party libraries for use in your own projects
  • Create your own libraries to share with others
Preface ix
1 The ABCs of C 1(20)
Strengths and Weaknesses
2(1)
Getting Started
2(17)
Tools Required
2(13)
Creating a C "Hello, World"
15(2)
Compiling Your Code
17(1)
Running Your Code
17(2)
Next Steps
19(2)
2 Storing and Stating 21(26)
Statements in C
21(3)
Statement Separators
22(1)
Statement Flow
22(2)
Variables and Types
24(10)
Getting User Input
24(3)
Strings and Characters
27(2)
Numbers
29(2)
Variable Names
31(1)
Variable Assignments
32(2)
printf() and scanf()
34(5)
printf() Formats
34(1)
Tailored Output
35(3)
scanf() and Parsing Inputs
38(1)
Operators and Expressions
39(6)
Arithmetic Operators
39(2)
Order of Operations
41(1)
Type Casting
42(3)
Next Steps
45(2)
3 Flow of Control 47(34)
Boolean Values
47(5)
Comparison Operators
48(1)
Logical Operators
49(3)
Branching
52(11)
The if Statement
52(6)
The switch Statement
58(5)
The Ternary Operator and Conditional Assignment
63(2)
Loop Statements
65(7)
The for Statement
65(4)
The while Statement
69(2)
The do/while Variation
71(1)
Nesting
72(5)
Nested Loops and Tables
74(1)
Variable Scope
75(2)
Exercises
77(2)
Next Steps
79(2)
4 Bits and (Many) Bytes 81(22)
Storing Multiple Things with Arrays
81(10)
Creating and Manipulating Arrays
82(6)
Review of Strings
88(1)
Multidimensional Arrays
89(1)
Accessing Elements in Multidimensional Arrays
90(1)
Storing Bits
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)
Bitwise Operators
96(1)
Mixing Bits and Bytes
97(4)
Conversion Answers
101(1)
Next Steps
102(1)
5 Functions 103(24)
Familiar Functions
104(1)
Function Flow
104(1)
Simple Functions
105(2)
Sending Information to Functions
107(4)
Passing Simple Types
107(1)
Passing Strings to Functions
108(2)
Multiple Types
110(1)
Exiting a Function
110(1)
Returning Information
111(3)
Using Returned Values
112(1)
Ignoring Returned Values
113(1)
Nested Calls and Recursion
114(4)
Recursive Functions
115(3)
Variable Scope
118(3)
Global Variables
119(2)
The main() Function
121(4)
Return values and main()
122(1)
Command-Line Arguments and main()
123(2)
Next Steps
125(2)
6 Pointers and References 127(22)
Addresses in C
127(7)
The NULL Value and Pointer Errors
129(1)
Arrays
130(1)
Local Variables and the Stack
131(2)
Global Variables and the Heap
133(1)
Pointer Arithmetic
134(1)
Array Pointers
135(2)
Functions and Pointers
137(1)
Managing Memory with Arrays
138(2)
Allocating with malloc()
138(1)
Deallocating with free()
139(1)
C Structures
140(5)
Defining Structures
141(1)
Assigning and Accessing Structure Members
141(1)
Pointers to Structures
142(1)
Functions and Structures
143(2)
Pointer Syntax Recap
145(2)
Next Steps
147(2)
7 Libraries 149(16)
The C Standard Library
150(11)
stdio.h
150(1)
stdlib.h
150(4)
string.h
154(3)
math.h
157(2)
time.h
159(1)
ctype.h
160(1)
Putting It Together
161(2)
Filling In Strings
161(1)
Finding Our Interest
162(1)
Finding New Libraries
163(1)
Next Steps
164(1)
8 Real-World C With Arduino 165(24)
Arduino IDE (Win, Mac, Linux)
166(3)
Installing on Windows
167(1)
Installing on macOS
168(1)
Installing on Linux
168(1)
Your First Arduino Project
169(7)
Selecting Your Board
170(2)
Hello, LED!
172(3)
An External LED Upgrade
175(1)
Arduino Libraries
176(3)
Managing Libraries
177(1)
Using Arduino Libraries
178(1)
Arduino Sketches and C++
179(8)
C++ Objects and Variables
182(1)
More Practice with Objects
183(2)
C++ Considerations
185(1)
Object Homework
186(1)
Next Steps
187(2)
9 Smaller Systems 189(32)
The Arduino Environment
189(8)
Special Values
190(2)
Special Types
192(1)
"Built-In" Functions
193(1)
Trying Out the Arduino "Stuff"
194(3)
Microcontroller I/O
197(9)
Sensors and Analog Input
197(1)
The Serial Monitor
198(1)
Is It Hot in Here?
199(1)
Segmented Displays
200(2)
Buttons and Digital Input
202(2)
Just How Hot Is It?
204(2)
Memory Management on Arduino
206(9)
Flash (PROGMEM)
206(3)
SRAM
209(2)
EEPROM
211(1)
Remembering Choices
212(3)
Interrupts
215(3)
Interrupt Service Routines
215(1)
Interrupt-Driven Programming
216(2)
Exercises
218(2)
Next Steps
220(1)
10 Faster Code 221(14)
The Setup
222(1)
Floating-Point Versus Integer Math
223(6)
Floating-Point Math Alternatives
224(1)
Integer Math Versus No Math
225(1)
Lookup Tables
226(1)
The Project So Far
227(2)
The Power of Powers of 2
229(1)
Loop Optimizations
230(2)
Unrolling for Fun and Profit
231(1)
Recursion Versus Iteration
232(1)
String Versus char[ ]
232(1)
Our Final Offer
233(1)
Next Steps
234(1)
11 Custom Libraries 235(32)
Creating Your Own Library
235(9)
Preprocessor Directives
238(1)
Preprocessor Macros
239(1)
Custom Type Definitions
240(1)
Our Car Project
241(3)
Multifile Projects
244(5)
Code (.ino) Files
244(3)
Header Files
247(2)
Importing Custom Libraries
249(16)
Facilitating Communication
249(1)
Retrofitting Our Car
250(2)
Creating a Controller
252(1)
Creating the Library
253(6)
Updating the Car Project
259(1)
Getting It Under Control
260(2)
Go Driving!
262(1)
Documentation and Distribution
262(3)
Next Steps
265(2)
12 Next Next Steps 267(8)
Intermediate and Advanced Topics
267(6)
IoT and Arduino
268(5)
Arduino Source Code
273(1)
Other Microcontrollers
273(1)
Industry C/C++
274(1)
Back to the Future
274(1)
A Hardware and Software 275(6)
B printf() Format Specifier Details 281(4)
Index 285
Marc Loy caught the programming bug after learning 6808 assembly to program his school's HERO 1 in the 80s. He developed and delivered training classes on Java, Unix internals, and networking at Sun Microsystems back in the day and has continued training a (much) wider audience ever since. He now spends his days consulting and writing on technical and media topics. He has also caught the maker bug and is exploring the fast-growing world of embedded electronics and wearables.