3. Arduino is an open-source electronics platform
based on easy-to-use hardware and software.
3
4. What is
● Open hardware ?
● Open software ?
● Arduino ?
4
5. Open Hardware
"Open hardware" or "open source
hardware," refers to the design
specifications of a physical object
which are licensed in such a way
that said object can be studied,
modified, created, and distributed by
anyone. "Open hardware" is a set of
design principles and legal practices,
not a specific type of object.
5
6. Open Software
Open-source software is computer
software that is released under a
license in which the copyright holder
grants users the rights to use, study,
change, and distribute the software
and its source code to anyone and for
any purpose. Open-source software
may be developed in a collaborative
public manner.
6
8. 8
“Strong Friend” Created in Ivrea, Italy
in 2005 by Massimo Banzi & David Cuartielles
Processor
Coding is accessible & transferrable (C++, java)
9. Arduino boards are able to read inputs
- light on a sensor, a finger on a
button, or a Twitter message - and
turn it into an output - activating a
motor, turning on an LED, publishing
something online and much more ……..
9
13. Arduino Mega
The Arduino Mega 2560 is a microcontroller board based on the
ATmega2560. It has 54 digital input/output pins (of which 15 can
be used as PWM outputs).
FLASH MEMORY : 256 KB of which 8 KB used by bootloader
SRAM : 8 KB
CLOCK SPEED : 16 MHz
13
16. Installation
For giving instructions to our board we have to code for Arduino and
have to upload the code to our board . For writing and uploading the
code we have to download a software (Arduino IDE) and have to
install in our Desktop/Laptop . The software download link :
https://www.arduino.cc/en/software
16
18. Data Types
Integer : used with integer variables with value between 2147483647 and -
2147483647.
Ex: int x=1200;
Character: used with single character, represent value from - 127 to 128.
Ex: char c=‘r’;
Long: Long variables are extended size variables for number storage, and store 32
bits (4 bytes), from -2,147,483,648 to 2,147,483,647.
Ex. long u=199203;
Floating-point: Numbers can be as large as 3.4028235E+38 and as low as -
3.4028235E+38. They are stored as 32 bits (4 bytes) of information.
Ex. float num=1.291;
18
19. Statement and Operators
Statement represents a command, it ends with ;
Ex: int x;
x=13;
Operators are symbols that used to indicate a specific function:
- Math operators: [+,-,*,/,%,^]
- Logic operators: [==, !=, &&, ||]
- Comparison operators: [==, >, <, !=, <=, >=]
Syntax:
; Semicolon,
{} curly braces,
//single line comment,
/*Multi-line comments*/
19
22. Control statements
Switch case:
switch (var) {
case 1: //do something when var equals 1
break;
case 2: //do something when var equals 2
break;
default: // if nothing else matches, do the default // default is optional
}
22
23. Loop statements
Do… while:
do {
Statements;
} while(condition); // the statements are run at least once.
While:
while(condition) {
Statements;
}
For:
for (int i=0; i <= val; i++){
statements;
}
23
24. Loop statements
Do… while:
do {
Statements;
} while(condition); // the statements are run at least once.
While:
while(condition) {
Statements;
}
For:
for (int i=0; i <= val; i++){
statements;
}
24
25. Code structure
Void setup(){}
//Used to indicate the initial values of system on starting.
Void loop(){}
//Contains the statements that will run whenever the system is
powered after setup.
25