1 the Arduino Coding
1 the Arduino Coding
Arduino IDE
(Integrated Development Environment) is a cross-
platform application that is written in functions from
C and C++. It is used to write and upload programs to
Arduino compatible boards, but also, with the help of
third-party cores, other vendor development boards.
2
ARDUINO IDE
3
ARDUINO IDE
4
void setup()
Is the function called when a sketch
starts.
It is use to initialize variables, pin
modes, libraries, etc.
It only run once after power up or
reset.
5
void loop()
Is the function that does precisely
what its name suggests, it loops
consecutively, allowing your program
to respond or change as you actively
control the Arduino board and its
components.
6
ARDUINO IDE
6 Buttons which is used for following:
1. The check mark is used to verify
your code. Click this once you have
written your code.
2. The arrow uploads your code to
the Arduino to run.
7
ARDUINO IDE
9
Function
10
Click icon to add picture
Function
11
Click icon to add picture
Data types
Data type Data Board
int x; -32,768 to 32,768 Arduino UNO or AT mega
based boards
float y; 3.5, 2.0
char txt1; A, D Character are defined
inside single quotes
char myString[14] = "Hello “this is a string” Strings are defined inside
Arduino"; double quotes
12
Click icon to add picture
If…else if…else
13
Click icon to add picture
Arithmetic operators
14
Click icon to add picture
Logical/Boolean operators
15
Click icon to add picture
Comparison operators
16
Click icon to add picture
If…else if…else
17
Click icon to add picture
switch case
18
Click icon to add picture
switch case
19
Click icon to add picture
do while
20
Click icon to add picture
while
21
Click icon to add picture
for
22
Click icon to add picture
break
23
Click icon to add picture
continue
24
Click icon to add picture
References
• https://arduinogetstarted.com/reference/arduino-else
25
Click icon to add picture
Click icon to add picture
26