Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learn Arduino Prototyping in 10 days

You're reading from   Learn Arduino Prototyping in 10 days Build it, test it, learn, try again!

Arrow left icon
Product type Paperback
Published in Jun 2017
Publisher Packt
ISBN-13 9781788290685
Length 288 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Kallol Bosu Roy Choudhuri Kallol Bosu Roy Choudhuri
Author Profile Icon Kallol Bosu Roy Choudhuri
Kallol Bosu Roy Choudhuri
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Boot Camp 2. The Arduino Platform FREE CHAPTER 3. Day 1 - Building a Simple Prototype 4. Day 2 - Interfacing with Sensors 5. Day 3 - Building a Compound Device 6. Day 4 - Building a Standalone Device 7. Day 5 - Using Actuators 8. Day 6 - Using AC Powered Components 9. Day 7 - The World of Transmitters, Receivers, and Transceivers 10. Day 8 - Short Range Wireless Communications 11. Day 9 - Long-Range Wireless Communications 12. Day 10 - The Internet of Things

Arduino program structure and execution

In this section we will study the general structure of an Arduino sketch. After going through this section you will be able to understand the important parts of an Arduino sketch. This section will also explain how each part of an Arduino sketch gets executed in the Arduino development board.

Arduino C programs are called sketches. A basic sketch structure needs at least two functions in the program body. These functions are listed as follows:

  • setup()
  • loop()

These functions should always have a same name that is, setup() and loop(). The Arduino development board is pre-programed to execute a loaded sketch by looking for these two function names in the body of a sketch. So if these two function names are not present in the C sketch, then the Arduino IDE will not even compile the sketch successfully. Instead the following errors will be...

You have been reading a chapter from
Learn Arduino Prototyping in 10 days
Published in: Jun 2017
Publisher: Packt
ISBN-13: 9781788290685
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image