Introduction To Arduino Masudur Rahman Sourav, ID : IT-19025, Session :2018-19, MBSTU 1
What is Arduino ? 2
Arduino is an open-source electronics platform based on easy-to-use hardware and software. 3
What is ● Open hardware ? ● Open software ? ● Arduino ? 4
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
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
7
8 “Strong Friend” Created in Ivrea, Italy in 2005 by Massimo Banzi & David Cuartielles Processor Coding is accessible & transferrable (C++, java)
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
Types of Arduino : 10
11
Getting Started with Arduino : 12
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
Arduino Mega 14
Arduino Mega 15 Fig : Functional Pins of Arduino Mega
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
Arduino Coding : 17
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
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
Statement and Operators Compound Operators: ++ (increment) -- (decrement) += (compound addition) -= (compound subtraction) *= (compound multiplication) /= (compound division) 20
Control statements If Conditioning: if(condition) { Statements-1; … Statement-N; } else if(condition2) { Statements; } else{ Statements; } 21
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
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
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
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
26 The End

Introduction to Arduino

  • 1.
    Introduction To Arduino MasudurRahman Sourav, ID : IT-19025, Session :2018-19, MBSTU 1
  • 2.
  • 3.
    Arduino is anopen-source electronics platform based on easy-to-use hardware and software. 3
  • 4.
    What is ● Openhardware ? ● 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 softwareis 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
  • 7.
  • 8.
    8 “Strong Friend” Createdin Ivrea, Italy in 2005 by Massimo Banzi & David Cuartielles Processor Coding is accessible & transferrable (C++, java)
  • 9.
    Arduino boards areable 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
  • 10.
  • 11.
  • 12.
  • 13.
    Arduino Mega The ArduinoMega 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
  • 14.
  • 15.
    Arduino Mega 15 Fig :Functional Pins of Arduino Mega
  • 16.
    Installation For giving instructionsto 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
  • 17.
  • 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 Statementrepresents 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
  • 20.
    Statement and Operators CompoundOperators: ++ (increment) -- (decrement) += (compound addition) -= (compound subtraction) *= (compound multiplication) /= (compound division) 20
  • 21.
    Control statements If Conditioning: if(condition){ Statements-1; … Statement-N; } else if(condition2) { Statements; } else{ Statements; } 21
  • 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(){} //Usedto indicate the initial values of system on starting. Void loop(){} //Contains the statements that will run whenever the system is powered after setup. 25
  • 26.