Learning C for Arduino 9781787120099, 1787120090, 9781787123571, 178712357X

Cover; Copyright; Credits; About the Author; About the Reviewer; www.PacktPub.com; Customer Feedback; Table of Contents;

248 113 19MB

English Pages 373 Year 2017

Report DMCA / Copyright

DOWNLOAD AZW3 FILE

Table of contents :
Cover
Copyright
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Table of Contents
Preface
Chapter 1: Getting Started
Arduino
Types of Arduino
Arduino Uno
Arduino Mega
Arduino Nano
Arduino Leonardo
Arduino Mini
Arduino Micro
Exploring Arduino Uno
USB port
External power jack
Analog pins
Digital pins
ICSP
Microcontroller
Reset button
Connecting Arduino to PC
Downloading and installing Arduino IDE
Downloading Arduino IDE
Installing Arduino IDE
Installing Arduino IDE on Windows
Installing Arduino IDE on Ubuntu/Linux. Installing Arduino IDE on MacExplore Arduino IDE
Summary
Chapter 2: Our First Program!
Connecting your Arduino
Hello Arduino!
Dissecting our first code
setup() function
loop() function
Things to remember
Watch your case
Don't forget your semicolon!
Adding both Setup() and Loop() functions
Minding the baud rate
Formatting your code
Turning the LED On
Blink a LED
Commenting
Try at home
Keyboard shortcuts
Summary
Chapter 3: Exploring C with Arduino IDE
Variables
Exercise
Data types
Integers
Rational numbers or fractions
Characters and strings
Booleans. Collecting and showing data through serial portMathematical operations
Addition
Subtraction
Exercise
Multiplication
Division
Modulus
Arrays
Exercise
Strings and operations with strings
Conversion of strings
Exercise
Summary
Chapter 4: Blinking with Operations and Loops
Expression in C
Logical operations in C
If-statement
Nested if
Logical operators
AND operator
OR operator
NOT operator
If-else
Switch-case
Exercises
Loops
for loop
Nested for loop
While loop
do-while loop
Exercise
Summary
Chapter 5: Functions and Files with Arduino
Functions
Types of functions. Functions with no arguments and a return valueFunction with arguments and no return value
Functions with arguments and a return value
Usages of functions
Exercise
Data logging
File handling
Connecting an SD card to your Arduino
Formatting the SD/Micro SD card
Connecting the module to the Arduino
Naming your data file
Reading a file
Importing a library
Setting CS/SS pin number
Writing on a file
Exercise
Summary
Chapter 6: Arduino and C++
Object Oriented Programming
Objects
Class
Going deeper into class
Understanding OOP better
Fundamentals of OOP
Encapsulation. Data AbstractionConstructor
Virtual function
Polymorphism
Pointer and reference in polymorphism
Method overload
Method overriding
Inheritance
Exercises
Benefits of OOP
Using OOP with Arduino
GSM modules
Types of GSM module
Getting to know SIM900A mini better
Connecting the GSM Shield to the Arduino
Arduino library
Making a call using GSM module
AT commands
Usages and rules of AT Commands
Sending an SMS
Receiving an SMS
Summary
Chapter 7: Using Pointers and Structure
Pointers
Declaring a pointer
Reference point
Types of pointers
Pointers and arrays
Usages of pointers.

Learning C for Arduino
 9781787120099, 1787120090, 9781787123571, 178712357X

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
Recommend Papers