- Arduino - Network Communication
- Arduino - Wireless Communication
- Arduino - Tone Library
- Arduino - Stepper Motor
- Arduino - Servo Motor
- Arduino - DC Motor
- Arduino - Connecting Switch
- Arduino - Ultrasonic Sensor
- Arduino - PIR Sensor
- Arduino - Water Detector / Sensor
- Arduino - Temperature Sensor
- Arduino - Humidity Sensor
- Arduino - Keyboard Serial
- Arduino - Mouse Button Control
- Arduino - Keyboard Message
- Arduino - Keyboard Logout
- Arduino - LED Bar Graph
- Arduino - Reading Analog Voltage
- Arduino - Fading LED
- Arduino - Blinking LED
- Arduino - Serial Peripheral Interface
- Arduino - Inter Integrated Circuit
- Arduino - Communication
- Arduino - Interrupts
- Arduino - Random Numbers
- Arduino - Pulse Width Modulation
- Arduino - Due & Zero
- Arduino - Trigonometric Functions
- Arduino - Math Library
- Arduino - Character Functions
- Arduino - Advanced I/O Function
- Arduino - I/O Functions
- Arduino - Arrays
- Arduino - Time
- Arduino - String Object
- Arduino - Strings
- Arduino - Functions
- Arduino - Loops
- Arduino - Control Statements
- Arduino - Operators
- Arduino - Variables & Constants
- Arduino - Data Types
- Arduino - Program Structure
- Arduino - Installation
- Arduino - Board Description
- Arduino - Overview
- Arduino - Home
Arduino Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Arduino - Program Structure
In this chapter, we will study in depth, the Arduino program structure and we will learn more new terminologies used in the Arduino world. The Arduino software is open-source. The source code for the Java environment is released under the GPL and the C/C++ microcontroller pbraries are under the LGPL.
Sketch − The first new terminology is the Arduino program called “sketch”.
Structure
Arduino programs can be spanided in three main parts: Structure, Values (variables and constants), and Functions. In this tutorial, we will learn about the Arduino software program, step by step, and how we can write the program without any syntax or compilation error.
Let us start with the Structure. Software structure consist of two main functions −
Setup( ) function
Loop( ) function
Void setup ( ) { }
PURPOSE − The setup() function is called when a sketch starts. Use it to initiapze the variables, pin modes, start using pbraries, etc. The setup function will only run once, after each power up or reset of the Arduino board.
INPUT − -
OUTPUT − -
RETURN − -
Void Loop ( ) { }
PURPOSE − After creating a setup() function, which initiapzes and sets the initial values, the loop() function does precisely what its name suggests, and loops consecutively, allowing your program to change and respond. Use it to actively control the Arduino board.
INPUT − -
OUTPUT − -
RETURN − -