SlideShare a Scribd company logo
Programming
of
Arduino
 Arduino programs can be divided in three
main parts:
 STRUCTURE
 VALUES -VARIABLES
-CONSTANTS
 FUNCTIONS
STRUCTURE
 The basic structure of the arduino programming language is fairly
simple and runs in atleast two parts.
 These two required parts,or functions, enclose blocks of statement.
Setup()
Setup() function is called when a sketch starts
Use to initialize variables , pin modes , start using
libraries etc…
It will only run once,after each powerup or reset.
So generally it is used to prepare your ardruino serial
communication and pinmode().
It must be included in program even if no lines are there.
Example
int buttonPin = 3;
void setup()
{
Serial.begin(9600);
pinMode(buttonPin, INPUT);
}
void loop()
{
// ...
}
Loop()
After calling the setup() function, the loop() function does
precisely what its name suggests, loops consecutively
 i.e it allows us to execute a statement or group of
statements multiple times.
Allows program to change, respond and control the Arduino
board.
Example
void loop()
{
digitalWrite( pin ,HIGH ); //turns ‘pin’ on
delay(1000); //pause for one second
digitalWrite( pin ,LOW ); //turns ‘pin’ off
delay(1000); //pause for one second
}
Variables
 A variable is a way of naming and storing a numerical value for later use.
 It can be continuously changed as opposed to constants whose value never changes.
 Data types says the size of variable.
 Eg: int a,b;
 The above statement declares a variable ‘a’ whose size can be of 16 bits.
 Initializations can be done while declaring or in further part of program.
 Eg: a=20; b=10 //initializing variable
a=b; //changing variable value
 You can use same variable name in same program but it depends
on scope of variable.
Functions
 A function is a block of code that has a name and a block of statements
that are executed when the function is called.
 Custom functions can be written to perform repetitive tasks and to
reduce clutter in program.
 Functions are declared by first declaring the function type.
 Function type tells the type of value to be written by the function.
 Eg: int a() //for integer type to be returned
 If no values is to be returned the function type would be void.
 After name of function name we pass can parameters of function in
parenthesis.
Example
int delayVal()
{
int v; //create temporary variable ‘v’
v = analogRead(pot); //read potentiometer value
v /= 4; //converts 0-1024 to 0-255
return v; //return final value
}
Basic Functions Of Arduino
Digital I/O
pinMode()
digitalWrite()
digitalRead()
Analog I/O
analogReference()
analogRead()
analogWrite() - PWM
Time
millis()
micros()
delay()
delayMicroseconds()
LED BLINK
Description:
In this lesson we will,
1. Build and wire a device with one LED, resistor, and
Arduino board.
2. Program the device to “Blink the Light”
3. Identify the flow of electricity / signal in this computing unit.
4. Use the Blockly Programming system to control speed of
Blink.
 You will need:
 1. LED Light Bulb (Any Colour)
 2. 330 Ohm Resistor
 3. Red Wire
 4. White Wire
 5. Black (Or dark colored Wire)
Process:
1. Run a red Wire from the 5V Pin to the Red Rail on the
Breadboard. This will connect the current side of the
circuit.
 2. Run a black (or dark coloured wire) from the Gnd Pin of
the Arduino to the Blue Rail on the far side of the
Breadboard.
Programming with arduino
 3. Plug an LED bulb into the circuit. Note that the longer pin will face the
Arduino Board and the pins should cross the “gap” in the breadboard.
 4. This step is VERY IMPORTANT!!! Plug a 330 OHM resistor from Port B5
to Ground (The blue rail).
 An LED bulb must ALWAYS have a Resistor in the circuit. If we do not use a
Resistor, we will burn out the bulb or the Arduino
5. Now we will run the signal wire. Wire Pin 13 on the
Arduino to the Breadboard. This will carry the current from
the Arduino Pin to the LED and allow the Arduino to switch
on and off the LED.
Sketch Programming:
1. Start your Arduino Sketch Program by clicking on
the Sketch Icon.
2. Save the code by selecting “File-Save” and
naming the program “lastnameBlink”.
Programming with arduino

More Related Content

What's hot (20)

Arduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoArduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic Arduino
Vishnu
 
Communication Protocols (UART, SPI,I2C)
Communication Protocols (UART, SPI,I2C)Communication Protocols (UART, SPI,I2C)
Communication Protocols (UART, SPI,I2C)
Emertxe Information Technologies Pvt Ltd
 
Arduino and c programming
Arduino and c programmingArduino and c programming
Arduino and c programming
Punit Goswami
 
Arduino Workshop
Arduino WorkshopArduino Workshop
Arduino Workshop
atuline
 
PPT ON Arduino
PPT ON Arduino PPT ON Arduino
PPT ON Arduino
Ravi Phadtare
 
PIC Microcontrollers
PIC MicrocontrollersPIC Microcontrollers
PIC Microcontrollers
Abdullah Saghir Ahmad
 
Introduction to Arduino Programming
Introduction to Arduino ProgrammingIntroduction to Arduino Programming
Introduction to Arduino Programming
James Lewis
 
Arduino Introduction (Blinking LED) Presentation (workshop #5)
Arduino  Introduction (Blinking LED)  Presentation (workshop #5)Arduino  Introduction (Blinking LED)  Presentation (workshop #5)
Arduino Introduction (Blinking LED) Presentation (workshop #5)
UNCG University Libraries
 
Arduino- Serial communication
Arduino-  Serial communicationArduino-  Serial communication
Arduino- Serial communication
Jawaher Abdulwahab Fadhil
 
IoT: An introduction
IoT: An introductionIoT: An introduction
IoT: An introduction
JWORKS powered by Ordina
 
LCD Theory and Working Principles
LCD Theory and Working PrinciplesLCD Theory and Working Principles
LCD Theory and Working Principles
Robo India
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
avikdhupar
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Green Moon Solutions
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Yong Heui Cho
 
Esp8266 basics
Esp8266 basicsEsp8266 basics
Esp8266 basics
Eueung Mulyana
 
Raspberry pi
Raspberry pi Raspberry pi
Raspberry pi
Anija Nair
 
Arduino uno
Arduino unoArduino uno
Arduino uno
Muhammad Khan
 
Introduction to arduino
Introduction to arduinoIntroduction to arduino
Introduction to arduino
Ahmed Sakr
 
Digital electronics
Digital electronicsDigital electronics
Digital electronics
callr
 
Arduino: On-board components description, IDE and Programming
Arduino: On-board components description, IDE and Programming Arduino: On-board components description, IDE and Programming
Arduino: On-board components description, IDE and Programming
Pawan Dubey, PhD
 
Arduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoArduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic Arduino
Vishnu
 
Arduino and c programming
Arduino and c programmingArduino and c programming
Arduino and c programming
Punit Goswami
 
Arduino Workshop
Arduino WorkshopArduino Workshop
Arduino Workshop
atuline
 
Introduction to Arduino Programming
Introduction to Arduino ProgrammingIntroduction to Arduino Programming
Introduction to Arduino Programming
James Lewis
 
Arduino Introduction (Blinking LED) Presentation (workshop #5)
Arduino  Introduction (Blinking LED)  Presentation (workshop #5)Arduino  Introduction (Blinking LED)  Presentation (workshop #5)
Arduino Introduction (Blinking LED) Presentation (workshop #5)
UNCG University Libraries
 
LCD Theory and Working Principles
LCD Theory and Working PrinciplesLCD Theory and Working Principles
LCD Theory and Working Principles
Robo India
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
avikdhupar
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Yong Heui Cho
 
Introduction to arduino
Introduction to arduinoIntroduction to arduino
Introduction to arduino
Ahmed Sakr
 
Digital electronics
Digital electronicsDigital electronics
Digital electronics
callr
 
Arduino: On-board components description, IDE and Programming
Arduino: On-board components description, IDE and Programming Arduino: On-board components description, IDE and Programming
Arduino: On-board components description, IDE and Programming
Pawan Dubey, PhD
 

Viewers also liked (20)

Arduino Full Tutorial
Arduino Full TutorialArduino Full Tutorial
Arduino Full Tutorial
Akshay Sharma
 
Arduino Lecture 2 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 2 - Interactive Media CS4062 Semester 2 2009Arduino Lecture 2 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 2 - Interactive Media CS4062 Semester 2 2009
Eoin Brazil
 
Arduino Development For Beginners
Arduino Development For BeginnersArduino Development For Beginners
Arduino Development For Beginners
FTS seminar
 
Arduino Lecture 3 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 3 - Interactive Media CS4062 Semester 2 2009Arduino Lecture 3 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 3 - Interactive Media CS4062 Semester 2 2009
Eoin Brazil
 
50 apps in 50 minutes
50 apps in 50 minutes50 apps in 50 minutes
50 apps in 50 minutes
Robert Schuetz
 
Aquaponics an urban friendly farming final
Aquaponics  an urban friendly farming finalAquaponics  an urban friendly farming final
Aquaponics an urban friendly farming final
Apparao Chodisetti
 
Intro to the Arduino Entrepreneurial System
Intro to the Arduino Entrepreneurial SystemIntro to the Arduino Entrepreneurial System
Intro to the Arduino Entrepreneurial System
todbotdotcom
 
IBC of Aquaponics
IBC of AquaponicsIBC of Aquaponics
IBC of Aquaponics
Arden Chan
 
Wireless Communication And Mobile Network - ZigBee
Wireless Communication And Mobile Network - ZigBeeWireless Communication And Mobile Network - ZigBee
Wireless Communication And Mobile Network - ZigBee
Xaver Y.R. Chen
 
Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009
Eoin Brazil
 
Future of Education Technology Conference Takeaways - 2016
Future of Education Technology Conference Takeaways - 2016Future of Education Technology Conference Takeaways - 2016
Future of Education Technology Conference Takeaways - 2016
Imagine Easy Solutions
 
Controlling an Arduino with Android
Controlling an Arduino with AndroidControlling an Arduino with Android
Controlling an Arduino with Android
A. Hernandez
 
Aquaponics Final Presentation
Aquaponics Final PresentationAquaponics Final Presentation
Aquaponics Final Presentation
thomasrey
 
Introduction to arduino!
Introduction to arduino!Introduction to arduino!
Introduction to arduino!
Makers of India
 
Aquaponics and Renewable Energy
Aquaponics and Renewable EnergyAquaponics and Renewable Energy
Aquaponics and Renewable Energy
Centre for Environment, Fisheries and Aquaculture Science (Cefas)
 
Starting a Commercial Aquaponics Farm - Bright Agrotech
Starting a Commercial Aquaponics Farm - Bright AgrotechStarting a Commercial Aquaponics Farm - Bright Agrotech
Starting a Commercial Aquaponics Farm - Bright Agrotech
Upstart University
 
Assembling a Vertical Aquaponics System
Assembling a Vertical Aquaponics SystemAssembling a Vertical Aquaponics System
Assembling a Vertical Aquaponics System
Upstart University
 
Manual basico de practicas con Arduino uno
Manual basico de practicas con Arduino unoManual basico de practicas con Arduino uno
Manual basico de practicas con Arduino uno
Ramiro Hernandez Michua
 
Curso Arduino práctico 2014
Curso Arduino práctico  2014Curso Arduino práctico  2014
Curso Arduino práctico 2014
Jose Antonio Vacas
 
Android Control Hardware and Arduino IoT ( 22 Aug 15 )
Android Control Hardware and Arduino IoT ( 22 Aug 15 )Android Control Hardware and Arduino IoT ( 22 Aug 15 )
Android Control Hardware and Arduino IoT ( 22 Aug 15 )
Adun Nanthakaew
 
Arduino Full Tutorial
Arduino Full TutorialArduino Full Tutorial
Arduino Full Tutorial
Akshay Sharma
 
Arduino Lecture 2 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 2 - Interactive Media CS4062 Semester 2 2009Arduino Lecture 2 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 2 - Interactive Media CS4062 Semester 2 2009
Eoin Brazil
 
Arduino Development For Beginners
Arduino Development For BeginnersArduino Development For Beginners
Arduino Development For Beginners
FTS seminar
 
Arduino Lecture 3 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 3 - Interactive Media CS4062 Semester 2 2009Arduino Lecture 3 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 3 - Interactive Media CS4062 Semester 2 2009
Eoin Brazil
 
Aquaponics an urban friendly farming final
Aquaponics  an urban friendly farming finalAquaponics  an urban friendly farming final
Aquaponics an urban friendly farming final
Apparao Chodisetti
 
Intro to the Arduino Entrepreneurial System
Intro to the Arduino Entrepreneurial SystemIntro to the Arduino Entrepreneurial System
Intro to the Arduino Entrepreneurial System
todbotdotcom
 
IBC of Aquaponics
IBC of AquaponicsIBC of Aquaponics
IBC of Aquaponics
Arden Chan
 
Wireless Communication And Mobile Network - ZigBee
Wireless Communication And Mobile Network - ZigBeeWireless Communication And Mobile Network - ZigBee
Wireless Communication And Mobile Network - ZigBee
Xaver Y.R. Chen
 
Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009
Eoin Brazil
 
Future of Education Technology Conference Takeaways - 2016
Future of Education Technology Conference Takeaways - 2016Future of Education Technology Conference Takeaways - 2016
Future of Education Technology Conference Takeaways - 2016
Imagine Easy Solutions
 
Controlling an Arduino with Android
Controlling an Arduino with AndroidControlling an Arduino with Android
Controlling an Arduino with Android
A. Hernandez
 
Aquaponics Final Presentation
Aquaponics Final PresentationAquaponics Final Presentation
Aquaponics Final Presentation
thomasrey
 
Introduction to arduino!
Introduction to arduino!Introduction to arduino!
Introduction to arduino!
Makers of India
 
Starting a Commercial Aquaponics Farm - Bright Agrotech
Starting a Commercial Aquaponics Farm - Bright AgrotechStarting a Commercial Aquaponics Farm - Bright Agrotech
Starting a Commercial Aquaponics Farm - Bright Agrotech
Upstart University
 
Assembling a Vertical Aquaponics System
Assembling a Vertical Aquaponics SystemAssembling a Vertical Aquaponics System
Assembling a Vertical Aquaponics System
Upstart University
 
Manual basico de practicas con Arduino uno
Manual basico de practicas con Arduino unoManual basico de practicas con Arduino uno
Manual basico de practicas con Arduino uno
Ramiro Hernandez Michua
 
Android Control Hardware and Arduino IoT ( 22 Aug 15 )
Android Control Hardware and Arduino IoT ( 22 Aug 15 )Android Control Hardware and Arduino IoT ( 22 Aug 15 )
Android Control Hardware and Arduino IoT ( 22 Aug 15 )
Adun Nanthakaew
 
Ad

Similar to Programming with arduino (20)

Arduino and Circuits.docx
Arduino and Circuits.docxArduino and Circuits.docx
Arduino and Circuits.docx
Ajay578679
 
Introduction to Arduino Microcontroller
Introduction to Arduino MicrocontrollerIntroduction to Arduino Microcontroller
Introduction to Arduino Microcontroller
Mujahid Hussain
 
Arduino programming
Arduino programmingArduino programming
Arduino programming
MdAshrafulAlam47
 
01 Intro to the Arduino and it's basics.ppt
01 Intro to the Arduino and it's basics.ppt01 Intro to the Arduino and it's basics.ppt
01 Intro to the Arduino and it's basics.ppt
pindi2197
 
Arduino Programming Basic
Arduino Programming BasicArduino Programming Basic
Arduino Programming Basic
LITS IT Ltd,LASRC.SPACE,SAWDAGOR BD,FREELANCE BD,iREV,BD LAW ACADEMY,SMART AVI,HEA,HFSAC LTD.
 
02 Sensors and Actuators Understand .pdf
02 Sensors and Actuators Understand .pdf02 Sensors and Actuators Understand .pdf
02 Sensors and Actuators Understand .pdf
engsharaf2025
 
Ch_2_8,9,10.pptx
Ch_2_8,9,10.pptxCh_2_8,9,10.pptx
Ch_2_8,9,10.pptx
yosikit826
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
baabtra.com - No. 1 supplier of quality freshers
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixels
sdcharle
 
Arduino Day 1 Presentation
Arduino Day 1 PresentationArduino Day 1 Presentation
Arduino Day 1 Presentation
Yogendra Tamang
 
Arduino cic3
Arduino cic3Arduino cic3
Arduino cic3
Jeni Shah
 
Lesson-4-Arduino-Programming-dsBasics.pdf
Lesson-4-Arduino-Programming-dsBasics.pdfLesson-4-Arduino-Programming-dsBasics.pdf
Lesson-4-Arduino-Programming-dsBasics.pdf
unicaeli2020
 
Arduino slides
Arduino slidesArduino slides
Arduino slides
sdcharle
 
Arduino Workshop Slides
Arduino Workshop SlidesArduino Workshop Slides
Arduino Workshop Slides
mkarlin14
 
Arduino-workshop.computer engineering.pdf
Arduino-workshop.computer engineering.pdfArduino-workshop.computer engineering.pdf
Arduino-workshop.computer engineering.pdf
AbhishekGiri933736
 
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptx
HebaEng
 
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdf
4 IOT 18ISDE712  MODULE 4 IoT Physical Devices and End Point-Aurdino  Uno.pdf4 IOT 18ISDE712  MODULE 4 IoT Physical Devices and End Point-Aurdino  Uno.pdf
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdf
Jayanthi Kannan MK
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
SAURABHKUMAR892774
 
Arduino - Module 1.pdf
Arduino - Module 1.pdfArduino - Module 1.pdf
Arduino - Module 1.pdf
razonclarence4
 
Arduino Foundations
Arduino FoundationsArduino Foundations
Arduino Foundations
John Breslin
 
Arduino and Circuits.docx
Arduino and Circuits.docxArduino and Circuits.docx
Arduino and Circuits.docx
Ajay578679
 
Introduction to Arduino Microcontroller
Introduction to Arduino MicrocontrollerIntroduction to Arduino Microcontroller
Introduction to Arduino Microcontroller
Mujahid Hussain
 
01 Intro to the Arduino and it's basics.ppt
01 Intro to the Arduino and it's basics.ppt01 Intro to the Arduino and it's basics.ppt
01 Intro to the Arduino and it's basics.ppt
pindi2197
 
02 Sensors and Actuators Understand .pdf
02 Sensors and Actuators Understand .pdf02 Sensors and Actuators Understand .pdf
02 Sensors and Actuators Understand .pdf
engsharaf2025
 
Ch_2_8,9,10.pptx
Ch_2_8,9,10.pptxCh_2_8,9,10.pptx
Ch_2_8,9,10.pptx
yosikit826
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixels
sdcharle
 
Arduino Day 1 Presentation
Arduino Day 1 PresentationArduino Day 1 Presentation
Arduino Day 1 Presentation
Yogendra Tamang
 
Arduino cic3
Arduino cic3Arduino cic3
Arduino cic3
Jeni Shah
 
Lesson-4-Arduino-Programming-dsBasics.pdf
Lesson-4-Arduino-Programming-dsBasics.pdfLesson-4-Arduino-Programming-dsBasics.pdf
Lesson-4-Arduino-Programming-dsBasics.pdf
unicaeli2020
 
Arduino slides
Arduino slidesArduino slides
Arduino slides
sdcharle
 
Arduino Workshop Slides
Arduino Workshop SlidesArduino Workshop Slides
Arduino Workshop Slides
mkarlin14
 
Arduino-workshop.computer engineering.pdf
Arduino-workshop.computer engineering.pdfArduino-workshop.computer engineering.pdf
Arduino-workshop.computer engineering.pdf
AbhishekGiri933736
 
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptx
HebaEng
 
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdf
4 IOT 18ISDE712  MODULE 4 IoT Physical Devices and End Point-Aurdino  Uno.pdf4 IOT 18ISDE712  MODULE 4 IoT Physical Devices and End Point-Aurdino  Uno.pdf
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdf
Jayanthi Kannan MK
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
SAURABHKUMAR892774
 
Arduino - Module 1.pdf
Arduino - Module 1.pdfArduino - Module 1.pdf
Arduino - Module 1.pdf
razonclarence4
 
Arduino Foundations
Arduino FoundationsArduino Foundations
Arduino Foundations
John Breslin
 
Ad

More from Makers of India (7)

Buzzer
BuzzerBuzzer
Buzzer
Makers of India
 
push button with led matrix
push button with led matrixpush button with led matrix
push button with led matrix
Makers of India
 
Arduino lcd display
Arduino lcd displayArduino lcd display
Arduino lcd display
Makers of India
 
Rgb
RgbRgb
Rgb
Makers of India
 
Integrated development environment
Integrated development environmentIntegrated development environment
Integrated development environment
Makers of India
 
Lm 35
Lm 35Lm 35
Lm 35
Makers of India
 
Led fade
Led  fadeLed  fade
Led fade
Makers of India
 

Recently uploaded (20)

Unit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdfUnit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdf
KRUTIKA CHANNE
 
How to Create an Event in Odoo 18 - Odoo 18 Slides
How to Create an Event in Odoo 18 - Odoo 18 SlidesHow to Create an Event in Odoo 18 - Odoo 18 Slides
How to Create an Event in Odoo 18 - Odoo 18 Slides
Celine George
 
Overview of Employee in Odoo 18 - Odoo Slides
Overview of Employee in Odoo 18 - Odoo SlidesOverview of Employee in Odoo 18 - Odoo Slides
Overview of Employee in Odoo 18 - Odoo Slides
Celine George
 
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdfFEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
ChristinaFortunova
 
LDMMIA GRAD Student Check-in Orientation Sampler
LDMMIA GRAD Student Check-in Orientation SamplerLDMMIA GRAD Student Check-in Orientation Sampler
LDMMIA GRAD Student Check-in Orientation Sampler
LDM & Mia eStudios
 
GEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdfGEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdf
SHERAZ AHMAD LONE
 
Unit 3 Poster Sketches with annotations.pptx
Unit 3 Poster Sketches with annotations.pptxUnit 3 Poster Sketches with annotations.pptx
Unit 3 Poster Sketches with annotations.pptx
bobby205207
 
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
parmarjuli1412
 
Final Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptxFinal Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptx
bobby205207
 
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti MpdBasic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Restu Bias Primandhika
 
Revista digital preescolar en transformación
Revista digital preescolar en transformaciónRevista digital preescolar en transformación
Revista digital preescolar en transformación
guerragallardo26
 
Rai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptx
Rai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptxRai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptx
Rai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptx
Dr. Ravi Shankar Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdfBlack and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
What is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptxWhat is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptx
Ramakrishna Reddy Bijjam
 
Nice Dream.pdf /
Nice Dream.pdf                              /Nice Dream.pdf                              /
Nice Dream.pdf /
ErinUsher3
 
Publishing Your Memoir with Brooke Warner
Publishing Your Memoir with Brooke WarnerPublishing Your Memoir with Brooke Warner
Publishing Your Memoir with Brooke Warner
Brooke Warner
 
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptxPEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
Arshad Shaikh
 
What are the benefits that dance brings?
What are the benefits that dance brings?What are the benefits that dance brings?
What are the benefits that dance brings?
memi27
 
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptxAnalysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Shrutidhara2
 
ABCs of Bookkeeping for Nonprofits TechSoup.pdf
ABCs of Bookkeeping for Nonprofits TechSoup.pdfABCs of Bookkeeping for Nonprofits TechSoup.pdf
ABCs of Bookkeeping for Nonprofits TechSoup.pdf
TechSoup
 
Unit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdfUnit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdf
KRUTIKA CHANNE
 
How to Create an Event in Odoo 18 - Odoo 18 Slides
How to Create an Event in Odoo 18 - Odoo 18 SlidesHow to Create an Event in Odoo 18 - Odoo 18 Slides
How to Create an Event in Odoo 18 - Odoo 18 Slides
Celine George
 
Overview of Employee in Odoo 18 - Odoo Slides
Overview of Employee in Odoo 18 - Odoo SlidesOverview of Employee in Odoo 18 - Odoo Slides
Overview of Employee in Odoo 18 - Odoo Slides
Celine George
 
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdfFEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
ChristinaFortunova
 
LDMMIA GRAD Student Check-in Orientation Sampler
LDMMIA GRAD Student Check-in Orientation SamplerLDMMIA GRAD Student Check-in Orientation Sampler
LDMMIA GRAD Student Check-in Orientation Sampler
LDM & Mia eStudios
 
GEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdfGEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdf
SHERAZ AHMAD LONE
 
Unit 3 Poster Sketches with annotations.pptx
Unit 3 Poster Sketches with annotations.pptxUnit 3 Poster Sketches with annotations.pptx
Unit 3 Poster Sketches with annotations.pptx
bobby205207
 
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
parmarjuli1412
 
Final Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptxFinal Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptx
bobby205207
 
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti MpdBasic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Restu Bias Primandhika
 
Revista digital preescolar en transformación
Revista digital preescolar en transformaciónRevista digital preescolar en transformación
Revista digital preescolar en transformación
guerragallardo26
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdfBlack and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
What is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptxWhat is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptx
Ramakrishna Reddy Bijjam
 
Nice Dream.pdf /
Nice Dream.pdf                              /Nice Dream.pdf                              /
Nice Dream.pdf /
ErinUsher3
 
Publishing Your Memoir with Brooke Warner
Publishing Your Memoir with Brooke WarnerPublishing Your Memoir with Brooke Warner
Publishing Your Memoir with Brooke Warner
Brooke Warner
 
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptxPEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
Arshad Shaikh
 
What are the benefits that dance brings?
What are the benefits that dance brings?What are the benefits that dance brings?
What are the benefits that dance brings?
memi27
 
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptxAnalysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Shrutidhara2
 
ABCs of Bookkeeping for Nonprofits TechSoup.pdf
ABCs of Bookkeeping for Nonprofits TechSoup.pdfABCs of Bookkeeping for Nonprofits TechSoup.pdf
ABCs of Bookkeeping for Nonprofits TechSoup.pdf
TechSoup
 

Programming with arduino

  • 2.  Arduino programs can be divided in three main parts:  STRUCTURE  VALUES -VARIABLES -CONSTANTS  FUNCTIONS
  • 3. STRUCTURE  The basic structure of the arduino programming language is fairly simple and runs in atleast two parts.  These two required parts,or functions, enclose blocks of statement.
  • 4. Setup() Setup() function is called when a sketch starts Use to initialize variables , pin modes , start using libraries etc… It will only run once,after each powerup or reset. So generally it is used to prepare your ardruino serial communication and pinmode(). It must be included in program even if no lines are there.
  • 5. Example int buttonPin = 3; void setup() { Serial.begin(9600); pinMode(buttonPin, INPUT); } void loop() { // ... }
  • 6. Loop() After calling the setup() function, the loop() function does precisely what its name suggests, loops consecutively  i.e it allows us to execute a statement or group of statements multiple times. Allows program to change, respond and control the Arduino board.
  • 7. Example void loop() { digitalWrite( pin ,HIGH ); //turns ‘pin’ on delay(1000); //pause for one second digitalWrite( pin ,LOW ); //turns ‘pin’ off delay(1000); //pause for one second }
  • 8. Variables  A variable is a way of naming and storing a numerical value for later use.  It can be continuously changed as opposed to constants whose value never changes.  Data types says the size of variable.  Eg: int a,b;  The above statement declares a variable ‘a’ whose size can be of 16 bits.  Initializations can be done while declaring or in further part of program.  Eg: a=20; b=10 //initializing variable a=b; //changing variable value  You can use same variable name in same program but it depends on scope of variable.
  • 9. Functions  A function is a block of code that has a name and a block of statements that are executed when the function is called.  Custom functions can be written to perform repetitive tasks and to reduce clutter in program.  Functions are declared by first declaring the function type.  Function type tells the type of value to be written by the function.  Eg: int a() //for integer type to be returned  If no values is to be returned the function type would be void.  After name of function name we pass can parameters of function in parenthesis.
  • 10. Example int delayVal() { int v; //create temporary variable ‘v’ v = analogRead(pot); //read potentiometer value v /= 4; //converts 0-1024 to 0-255 return v; //return final value }
  • 11. Basic Functions Of Arduino Digital I/O pinMode() digitalWrite() digitalRead() Analog I/O analogReference() analogRead() analogWrite() - PWM Time millis() micros() delay() delayMicroseconds()
  • 12. LED BLINK Description: In this lesson we will, 1. Build and wire a device with one LED, resistor, and Arduino board. 2. Program the device to “Blink the Light” 3. Identify the flow of electricity / signal in this computing unit. 4. Use the Blockly Programming system to control speed of Blink.
  • 13.  You will need:  1. LED Light Bulb (Any Colour)  2. 330 Ohm Resistor  3. Red Wire  4. White Wire  5. Black (Or dark colored Wire)
  • 14. Process: 1. Run a red Wire from the 5V Pin to the Red Rail on the Breadboard. This will connect the current side of the circuit.  2. Run a black (or dark coloured wire) from the Gnd Pin of the Arduino to the Blue Rail on the far side of the Breadboard.
  • 16.  3. Plug an LED bulb into the circuit. Note that the longer pin will face the Arduino Board and the pins should cross the “gap” in the breadboard.  4. This step is VERY IMPORTANT!!! Plug a 330 OHM resistor from Port B5 to Ground (The blue rail).  An LED bulb must ALWAYS have a Resistor in the circuit. If we do not use a Resistor, we will burn out the bulb or the Arduino
  • 17. 5. Now we will run the signal wire. Wire Pin 13 on the Arduino to the Breadboard. This will carry the current from the Arduino Pin to the LED and allow the Arduino to switch on and off the LED.
  • 18. Sketch Programming: 1. Start your Arduino Sketch Program by clicking on the Sketch Icon. 2. Save the code by selecting “File-Save” and naming the program “lastnameBlink”.