Beginning C for Arduino : learn C programming for the Arduino /
Beginning C for Arduino, Second Edition is written for those who have no prior experience with microcontrollers or programming but would like to experiment and learn both. Updated with new projects and new boards, this book introduces you to the C programming language, reinforcing each programming s...
[New York] :
Apress : Distributed to the Book trade worldwide by Springer Science+Business Media,
|Series:||Technology in action series.
Table of Contents:
- Loading and Running Your First ProgramWriting Your First Program; What the Program Does; Compiling and Uploading a Program; Summary; Chapter 2: Arduino C; The Building Blocks of All Programming Languages; Expressions; Statements; Operator Precedence; Statement Blocks; Function Blocks; The Five Program Steps; 1. Initialization Step; 2. Input Step; 3. Process Step; 4. Output Step; 5. Termination Step; The Purpose of the Five Program Steps; A Revisit to Your First Program; The setup() Function; The loop() Function; Arduino Program Requirements; The Blink Program; Program Comments.
- Single-Line CommentsMulti-line Comments; When to Use Comments; The setup() Function in Blink; How to Find Information About Library Functions; The loop() Function; delay(): Good News, Bad News; Summary; Chapter 3: Arduino C Data Types; Keywords in C; Variable Names in C; The boolean Data Type; Walking Through the Function Call to ReadSwitchState (); Binary Numbers; The char Data Type and Character Sets; Generating a Table of ASCII Characters; The byte Data Type; The int Data Type; The word Data Type; The long Data Type; The float and double Data Types; Floating Point Precision.
- The string Data TypeString Data Type; Which Is Better: String or strings Built from char Arrays?; The void Data Type; The array Data Type; Array Generalizations; Defining vs. Declaring Variables; Language Errors; Symbol Tables; lvalues and rvalues; Understanding an Assignment Statement; The Bucket Analogy; Using the cast Operator; The Cast Rule; Silent Casts; Summary; Chapter 4: Decision Making in C; Relational Operators; The if Statement; What if Expression1 Is Logic True?; What if Expression1 Is Logic False?; Braces or No Braces?; A Modified Blink Program; The Circuit.
- Circuit Resistor ValuesThe Modified Blink Program; const Keyword; Software Modifications to the Alternate Blink Program; The if-else Statement Block; Cascading if statements; The Increment and Decrement Operators; Two Types of Increment Operators (++); Two Flavors of the Decrement Operator(
- ); Precedence of Operators; The switch statement; A switch Variation, the Ellipsis Operator (...); Which to Use: Cascading if-else or switch?; The goto Statement; Getting Rid of Magic Numbers; The C Preprocessor; Heads or Tails; Initialization Step; Input Step; Process Step; Output Step; Termination Step.