SlideShare ist ein Scribd-Unternehmen logo
1 von 29
Downloaden Sie, um offline zu lesen
ARDUINO PROGRAMMING
SESSION 1
Presented By
Amarjeetsingh Thakur
9/28/2020 1
What is Arduino?
• Arduino is an open- source computer
hardware and software company, project
and user community that designs and
manufactures microcontroller-based kits for
building systems consisting of digital
devices, interactive objects that can sense
and control in the physical world.
9/28/2020 2
How to program Arduino?
• The Arduino Integrated Development
Environment (IDE) supports
the C and C++ programming languages using
special rules of code organization.
• The Arduino IDE supplies a software library
called "Wiring" from the Wiring project, which
provides many common input and output
procedures.
9/28/2020 3
Arduino Products
9/28/2020 4
Entry Level
9/28/2020 5
Enhanced Features
9/28/2020 6
Official Website:
https://www.arduino.cc/
9/28/2020 7
ARDUINO UNO
9/28/2020 8
Technical specifications:
• Microcontroller: Microchip ATmega328P
• Operating Voltage: 5 Volt
• Input Voltage: 7 to 20 Volts
• Digital I/O Pins: 14 (of which 6 provide PWM output)
• Analog Input Pins: 6
• DC Current per I/O Pin: 20 mA
• DC Current for 3.3V Pin: 50 mA
• Flash Memory: 32 KB of which 0.5 KB used by bootloader
• SRAM: 2 KB
• EEPROM: 1 KB
• Clock Speed: 16 MHz
• Length: 68.6 mm
• Width: 53.4 mm
• Weight: 25 g
9/28/2020 9
Program Structure
Setup( )
{
// A function that runs once at the start of a program and is used to
set //pinMode or initialize serial communication
}
loop( )
{
// This function includes the code to be executed continuously – reading
inputs, //triggering outputs, etc.
// This function is the core of all Arduino programs and does the bulk of
the //work.
}
9/28/2020 10
Activity 1.1
Type : Team of 2 Duration : 15 Minutes
Use LED blink program from example
and upload it on the ARDUINO board
9/28/2020 11
Functions to handle digital I/O
• pinMode (pin, OUTPUT);
// make the digital pin either INPUT or OUTPUT
• digitalRead (pin);
//used to get the content on the pin which is HIGH(1)
or LOW(0)
• digitalWrite(pin, value)
//used to send HIGH(1) or LOW(0) value to a pin
9/28/2020 12
Time Function
• delay(ms)
// waits for milli – seconds
9/28/2020 13
/*….. Program to blink the LED on pin 13 …..*/
void setup( )
{
pinMode(13, OUTPUT); //Initialize the digital pin as output
}
void loop( )
{
digitalWrite(13, HIGH); // Turn the LED ON
delay(1000); // Wait for one second
digitalWrite(13, LOW); // Turn the LED OFF
delay(1000); // Wait for one second
}
9/28/2020 14
Activity 1.2
Type : Team of 2 Duration : 10 Minutes
Modify the program to blink LED every 2 sec
on pin 12.
9/28/2020 15
Circuit for the LED
Cathode of
LED
Anode of LED
9/28/2020 16
/*….. Program to blink the LED every 2 second on pin12*/
void setup( )
{
pinMode(12, OUTPUT); //Initialize the digital pin as output
}
void loop( )
{
digitalWrite(12, HIGH); // Turn the LED ON
delay(2000); // Wait for a two second
digitalWrite(12, LOW); // Turn the LED OFF
delay(2000); // Wait for a two second
}
9/28/2020 17
Activity 1.3
Type : Team of 2 Duration : 15 Minutes
Modify the program to display the LED state
every 2 sec on Serial Monitor.
9/28/2020 18
Serial communication with Arduino
What is serial communication ?
9/28/2020 19
The word serial means "one after the other."
• What is Baud rate ?
Number of symbols transferred per sec
9/28/2020 20
Serial Display Functions
• Serial.begin(baud_rate)
//baud rate(characters per sec) between computer
and board is typically 9600 although you can
work with other speeds by changing settings of
COM Port
• Serial.print(value),
//value could be any data and even string
• Serial.println(value)
//print in new line
9/28/2020 21
Eg. Print INDIA on serial monitor
void setup( )
{
Serial.begin(9600);// 9600 is default baud rate of
serial com port of a computer
}
void loop( )
{
Serial.println(“INDIA”); // Send the value “INDIA”
}
9/28/2020 22
Serial Monitor
9/28/2020 23
/*….. Modify the program to blink on pin12 and display the LED state every 2 sec
on Serial Monitor…..*/
void setup( )
{
pinMode(12, OUTPUT); //Initialize the digital pin as output
Serial.begin(9600);
}
void loop( )
{
digitalWrite(12, HIGH); // Turn the LED ON
Serial.println(“ON”); // Send the value “ON”
delay(2000); // Wait for a second
digitalWrite(12, LOW); // Turn the LED OFF
Serial.println(“OFF”); // Send the value “OFF”
delay(2000); // Wait for a second
}
9/28/2020 24
Activity 1.4
Type : Team of 2 Duration : 25 Minutes
Modify the program to blink 10 times per
loop iteration and display no. of loop
iterations on serial monitor.
9/28/2020 25
Looping Concept
//for loop concept
Syntax –
for(initialization ; condition; increment / decrement)
{
//code which you want to perform
}
Example : to print number from 1 to 10
for(int i=1;i<=10;i++)
{
Serial.println(i);
Serial.println(“INDIA”);
}
9/28/2020 26
long int Count=0;
void setup( )
{
pinMode(12, OUTPUT); //Initialize the digital pin as output
Serial.begin(9600);
Serial.println(“count of iterations running are: “);
}
void loop( )
{
for (int i=1;i<=10;i++)
{
Serial.println(i);
digitalWrite(12, HIGH);
Serial.println(“ON”);
delay(1000); // wait for a second
digitalWrite(12, LOW);
– Serial.println(“OFF”);
delay(1000); // wait for a second
}
Count++;
– Serial.print(“Iteration:”);
Serial.println(Count);
}9/28/2020 27
Condition Statements
if(Condition 1)
{
//Statements
}
if(Condition 2)
{
//Statements
}
else
{
//Statements
}
9/28/2020 28
Topic Learning Outcomes
At the end of the topic the student should be able to
1. Explain the importance of platform based development
2. Use looping, delay and conditioning concepts in developing a
program on Arduino environment.
9/28/2020 29

Weitere ähnliche Inhalte

Was ist angesagt? (20)

Arduino
ArduinoArduino
Arduino
 
Snort
SnortSnort
Snort
 
Fun with arduino
Fun with arduinoFun with arduino
Fun with arduino
 
Arduino Programming Basic
Arduino Programming BasicArduino Programming Basic
Arduino Programming Basic
 
Esp8266 NodeMCU
Esp8266 NodeMCUEsp8266 NodeMCU
Esp8266 NodeMCU
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Arduino presentation
Arduino presentationArduino presentation
Arduino presentation
 
Arduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIYArduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIY
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Arduino & NodeMcu
Arduino & NodeMcuArduino & NodeMcu
Arduino & NodeMcu
 
Arduino presentation by_warishusain
Arduino presentation by_warishusainArduino presentation by_warishusain
Arduino presentation by_warishusain
 
Arduino Introduction Presentation
Arduino Introduction PresentationArduino Introduction Presentation
Arduino Introduction Presentation
 
Esp8266 basics
Esp8266 basicsEsp8266 basics
Esp8266 basics
 
Arduino presentation
Arduino presentationArduino presentation
Arduino presentation
 
Nodemcu - introduction
Nodemcu - introductionNodemcu - introduction
Nodemcu - introduction
 
Raspberry Pi (Introduction)
Raspberry Pi (Introduction)Raspberry Pi (Introduction)
Raspberry Pi (Introduction)
 
Arduino IDE
Arduino IDE Arduino IDE
Arduino IDE
 
Lecture 3 - Software for the Internet of Things
Lecture 3 - Software for the Internet of ThingsLecture 3 - Software for the Internet of Things
Lecture 3 - Software for the Internet of Things
 
Arduino slides
Arduino slidesArduino slides
Arduino slides
 
Arduino
ArduinoArduino
Arduino
 

Ähnlich wie Arduino programming part1

Intel galileo gen 2
Intel galileo gen 2Intel galileo gen 2
Intel galileo gen 2srknec
 
Introduction to arduino Programming with
Introduction to arduino Programming withIntroduction to arduino Programming with
Introduction to arduino Programming withlikhithkumpala159
 
Introduction to Arduino Microcontroller
Introduction to Arduino MicrocontrollerIntroduction to Arduino Microcontroller
Introduction to Arduino MicrocontrollerMujahid Hussain
 
Arduino by bishal bhattarai IOE, Pashchimanchal Campus Pokhara, Nepal
Arduino by bishal bhattarai  IOE, Pashchimanchal Campus Pokhara, NepalArduino by bishal bhattarai  IOE, Pashchimanchal Campus Pokhara, Nepal
Arduino by bishal bhattarai IOE, Pashchimanchal Campus Pokhara, Nepalbishal bhattarai
 
Arduino_UNO _tutorial_For_Beginners.pptx
Arduino_UNO _tutorial_For_Beginners.pptxArduino_UNO _tutorial_For_Beginners.pptx
Arduino_UNO _tutorial_For_Beginners.pptxANIKDUTTA25
 
YAPC2011-Perlでちょいモテ電子工作
YAPC2011-Perlでちょいモテ電子工作YAPC2011-Perlでちょいモテ電子工作
YAPC2011-Perlでちょいモテ電子工作Yuki Manno
 
Cassiopeia Ltd - standard Arduino workshop
Cassiopeia Ltd - standard Arduino workshopCassiopeia Ltd - standard Arduino workshop
Cassiopeia Ltd - standard Arduino workshoptomtobback
 
Powerful Electronics with Arduino
Powerful Electronics with ArduinoPowerful Electronics with Arduino
Powerful Electronics with ArduinoAbdallah Hodieb
 
Arduino final ppt
Arduino final pptArduino final ppt
Arduino final pptIndu Mathi
 
Arduino workshop
Arduino workshopArduino workshop
Arduino workshopmayur1432
 
Scottish Ruby Conference 2010 Arduino, Ruby RAD
Scottish Ruby Conference 2010 Arduino, Ruby RADScottish Ruby Conference 2010 Arduino, Ruby RAD
Scottish Ruby Conference 2010 Arduino, Ruby RADlostcaggy
 
Multi Sensory Communication 1/2
Multi Sensory Communication 1/2Multi Sensory Communication 1/2
Multi Sensory Communication 1/2Satoru Tokuhisa
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduinoelwalia
 
IOT WORKSHEET 1.4.pdf
IOT WORKSHEET 1.4.pdfIOT WORKSHEET 1.4.pdf
IOT WORKSHEET 1.4.pdfMayuRana1
 

Ähnlich wie Arduino programming part1 (20)

Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Intel galileo gen 2
Intel galileo gen 2Intel galileo gen 2
Intel galileo gen 2
 
Introduction to arduino Programming with
Introduction to arduino Programming withIntroduction to arduino Programming with
Introduction to arduino Programming with
 
Introduction to Arduino Microcontroller
Introduction to Arduino MicrocontrollerIntroduction to Arduino Microcontroller
Introduction to Arduino Microcontroller
 
Aurdino presentation
Aurdino presentationAurdino presentation
Aurdino presentation
 
How to use an Arduino
How to use an ArduinoHow to use an Arduino
How to use an Arduino
 
arduinoedit.pptx
arduinoedit.pptxarduinoedit.pptx
arduinoedit.pptx
 
Arduino by bishal bhattarai IOE, Pashchimanchal Campus Pokhara, Nepal
Arduino by bishal bhattarai  IOE, Pashchimanchal Campus Pokhara, NepalArduino by bishal bhattarai  IOE, Pashchimanchal Campus Pokhara, Nepal
Arduino by bishal bhattarai IOE, Pashchimanchal Campus Pokhara, Nepal
 
Arduino_UNO _tutorial_For_Beginners.pptx
Arduino_UNO _tutorial_For_Beginners.pptxArduino_UNO _tutorial_For_Beginners.pptx
Arduino_UNO _tutorial_For_Beginners.pptx
 
YAPC2011-Perlでちょいモテ電子工作
YAPC2011-Perlでちょいモテ電子工作YAPC2011-Perlでちょいモテ電子工作
YAPC2011-Perlでちょいモテ電子工作
 
Cassiopeia Ltd - standard Arduino workshop
Cassiopeia Ltd - standard Arduino workshopCassiopeia Ltd - standard Arduino workshop
Cassiopeia Ltd - standard Arduino workshop
 
Powerful Electronics with Arduino
Powerful Electronics with ArduinoPowerful Electronics with Arduino
Powerful Electronics with Arduino
 
Arduino tutorial A to Z
Arduino tutorial A to ZArduino tutorial A to Z
Arduino tutorial A to Z
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Arduino final ppt
Arduino final pptArduino final ppt
Arduino final ppt
 
Arduino workshop
Arduino workshopArduino workshop
Arduino workshop
 
Scottish Ruby Conference 2010 Arduino, Ruby RAD
Scottish Ruby Conference 2010 Arduino, Ruby RADScottish Ruby Conference 2010 Arduino, Ruby RAD
Scottish Ruby Conference 2010 Arduino, Ruby RAD
 
Multi Sensory Communication 1/2
Multi Sensory Communication 1/2Multi Sensory Communication 1/2
Multi Sensory Communication 1/2
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
IOT WORKSHEET 1.4.pdf
IOT WORKSHEET 1.4.pdfIOT WORKSHEET 1.4.pdf
IOT WORKSHEET 1.4.pdf
 

Mehr von Amarjeetsingh Thakur

“Introduction to MATLAB & SIMULINK”
“Introduction to MATLAB  & SIMULINK”“Introduction to MATLAB  & SIMULINK”
“Introduction to MATLAB & SIMULINK”Amarjeetsingh Thakur
 
Python code for servo control using Raspberry Pi
Python code for servo control using Raspberry PiPython code for servo control using Raspberry Pi
Python code for servo control using Raspberry PiAmarjeetsingh Thakur
 
Python code for Push button using Raspberry Pi
Python code for Push button using Raspberry PiPython code for Push button using Raspberry Pi
Python code for Push button using Raspberry PiAmarjeetsingh Thakur
 
Python code for Buzzer Control using Raspberry Pi
Python code for Buzzer Control using Raspberry PiPython code for Buzzer Control using Raspberry Pi
Python code for Buzzer Control using Raspberry PiAmarjeetsingh Thakur
 
Introduction to Internet of Things (IoT)
Introduction to Internet of Things (IoT)Introduction to Internet of Things (IoT)
Introduction to Internet of Things (IoT)Amarjeetsingh Thakur
 
Introduction to Things board (An Open Source IoT Cloud Platform)
Introduction to Things board (An Open Source IoT Cloud Platform)Introduction to Things board (An Open Source IoT Cloud Platform)
Introduction to Things board (An Open Source IoT Cloud Platform)Amarjeetsingh Thakur
 
Introduction to MQ Telemetry Transport (MQTT)
Introduction to MQ Telemetry Transport (MQTT)Introduction to MQ Telemetry Transport (MQTT)
Introduction to MQ Telemetry Transport (MQTT)Amarjeetsingh Thakur
 
Arduino Interfacing with different sensors and motor
Arduino Interfacing with different sensors and motorArduino Interfacing with different sensors and motor
Arduino Interfacing with different sensors and motorAmarjeetsingh Thakur
 

Mehr von Amarjeetsingh Thakur (19)

“Introduction to MATLAB & SIMULINK”
“Introduction to MATLAB  & SIMULINK”“Introduction to MATLAB  & SIMULINK”
“Introduction to MATLAB & SIMULINK”
 
Python code for servo control using Raspberry Pi
Python code for servo control using Raspberry PiPython code for servo control using Raspberry Pi
Python code for servo control using Raspberry Pi
 
Python code for Push button using Raspberry Pi
Python code for Push button using Raspberry PiPython code for Push button using Raspberry Pi
Python code for Push button using Raspberry Pi
 
Python code for Buzzer Control using Raspberry Pi
Python code for Buzzer Control using Raspberry PiPython code for Buzzer Control using Raspberry Pi
Python code for Buzzer Control using Raspberry Pi
 
Arduino programming part 2
Arduino programming part 2Arduino programming part 2
Arduino programming part 2
 
Python openCV codes
Python openCV codesPython openCV codes
Python openCV codes
 
Python Numpy Source Codes
Python Numpy Source CodesPython Numpy Source Codes
Python Numpy Source Codes
 
Steemit html blog
Steemit html blogSteemit html blog
Steemit html blog
 
Python OpenCV Real Time projects
Python OpenCV Real Time projectsPython OpenCV Real Time projects
Python OpenCV Real Time projects
 
Adafruit_IoT_Platform
Adafruit_IoT_PlatformAdafruit_IoT_Platform
Adafruit_IoT_Platform
 
Core python programming tutorial
Core python programming tutorialCore python programming tutorial
Core python programming tutorial
 
Python openpyxl
Python openpyxlPython openpyxl
Python openpyxl
 
Introduction to Internet of Things (IoT)
Introduction to Internet of Things (IoT)Introduction to Internet of Things (IoT)
Introduction to Internet of Things (IoT)
 
Introduction to Node MCU
Introduction to Node MCUIntroduction to Node MCU
Introduction to Node MCU
 
Introduction to Things board (An Open Source IoT Cloud Platform)
Introduction to Things board (An Open Source IoT Cloud Platform)Introduction to Things board (An Open Source IoT Cloud Platform)
Introduction to Things board (An Open Source IoT Cloud Platform)
 
Introduction to MQ Telemetry Transport (MQTT)
Introduction to MQ Telemetry Transport (MQTT)Introduction to MQ Telemetry Transport (MQTT)
Introduction to MQ Telemetry Transport (MQTT)
 
Arduino Interfacing with different sensors and motor
Arduino Interfacing with different sensors and motorArduino Interfacing with different sensors and motor
Arduino Interfacing with different sensors and motor
 
Image processing in MATLAB
Image processing in MATLABImage processing in MATLAB
Image processing in MATLAB
 
Image Processing Using MATLAB
Image Processing Using MATLABImage Processing Using MATLAB
Image Processing Using MATLAB
 

Kürzlich hochgeladen

VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Christo Ananth
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 

Kürzlich hochgeladen (20)

VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 

Arduino programming part1

  • 1. ARDUINO PROGRAMMING SESSION 1 Presented By Amarjeetsingh Thakur 9/28/2020 1
  • 2. What is Arduino? • Arduino is an open- source computer hardware and software company, project and user community that designs and manufactures microcontroller-based kits for building systems consisting of digital devices, interactive objects that can sense and control in the physical world. 9/28/2020 2
  • 3. How to program Arduino? • The Arduino Integrated Development Environment (IDE) supports the C and C++ programming languages using special rules of code organization. • The Arduino IDE supplies a software library called "Wiring" from the Wiring project, which provides many common input and output procedures. 9/28/2020 3
  • 9. Technical specifications: • Microcontroller: Microchip ATmega328P • Operating Voltage: 5 Volt • Input Voltage: 7 to 20 Volts • Digital I/O Pins: 14 (of which 6 provide PWM output) • Analog Input Pins: 6 • DC Current per I/O Pin: 20 mA • DC Current for 3.3V Pin: 50 mA • Flash Memory: 32 KB of which 0.5 KB used by bootloader • SRAM: 2 KB • EEPROM: 1 KB • Clock Speed: 16 MHz • Length: 68.6 mm • Width: 53.4 mm • Weight: 25 g 9/28/2020 9
  • 10. Program Structure Setup( ) { // A function that runs once at the start of a program and is used to set //pinMode or initialize serial communication } loop( ) { // This function includes the code to be executed continuously – reading inputs, //triggering outputs, etc. // This function is the core of all Arduino programs and does the bulk of the //work. } 9/28/2020 10
  • 11. Activity 1.1 Type : Team of 2 Duration : 15 Minutes Use LED blink program from example and upload it on the ARDUINO board 9/28/2020 11
  • 12. Functions to handle digital I/O • pinMode (pin, OUTPUT); // make the digital pin either INPUT or OUTPUT • digitalRead (pin); //used to get the content on the pin which is HIGH(1) or LOW(0) • digitalWrite(pin, value) //used to send HIGH(1) or LOW(0) value to a pin 9/28/2020 12
  • 13. Time Function • delay(ms) // waits for milli – seconds 9/28/2020 13
  • 14. /*….. Program to blink the LED on pin 13 …..*/ void setup( ) { pinMode(13, OUTPUT); //Initialize the digital pin as output } void loop( ) { digitalWrite(13, HIGH); // Turn the LED ON delay(1000); // Wait for one second digitalWrite(13, LOW); // Turn the LED OFF delay(1000); // Wait for one second } 9/28/2020 14
  • 15. Activity 1.2 Type : Team of 2 Duration : 10 Minutes Modify the program to blink LED every 2 sec on pin 12. 9/28/2020 15
  • 16. Circuit for the LED Cathode of LED Anode of LED 9/28/2020 16
  • 17. /*….. Program to blink the LED every 2 second on pin12*/ void setup( ) { pinMode(12, OUTPUT); //Initialize the digital pin as output } void loop( ) { digitalWrite(12, HIGH); // Turn the LED ON delay(2000); // Wait for a two second digitalWrite(12, LOW); // Turn the LED OFF delay(2000); // Wait for a two second } 9/28/2020 17
  • 18. Activity 1.3 Type : Team of 2 Duration : 15 Minutes Modify the program to display the LED state every 2 sec on Serial Monitor. 9/28/2020 18
  • 19. Serial communication with Arduino What is serial communication ? 9/28/2020 19
  • 20. The word serial means "one after the other." • What is Baud rate ? Number of symbols transferred per sec 9/28/2020 20
  • 21. Serial Display Functions • Serial.begin(baud_rate) //baud rate(characters per sec) between computer and board is typically 9600 although you can work with other speeds by changing settings of COM Port • Serial.print(value), //value could be any data and even string • Serial.println(value) //print in new line 9/28/2020 21
  • 22. Eg. Print INDIA on serial monitor void setup( ) { Serial.begin(9600);// 9600 is default baud rate of serial com port of a computer } void loop( ) { Serial.println(“INDIA”); // Send the value “INDIA” } 9/28/2020 22
  • 24. /*….. Modify the program to blink on pin12 and display the LED state every 2 sec on Serial Monitor…..*/ void setup( ) { pinMode(12, OUTPUT); //Initialize the digital pin as output Serial.begin(9600); } void loop( ) { digitalWrite(12, HIGH); // Turn the LED ON Serial.println(“ON”); // Send the value “ON” delay(2000); // Wait for a second digitalWrite(12, LOW); // Turn the LED OFF Serial.println(“OFF”); // Send the value “OFF” delay(2000); // Wait for a second } 9/28/2020 24
  • 25. Activity 1.4 Type : Team of 2 Duration : 25 Minutes Modify the program to blink 10 times per loop iteration and display no. of loop iterations on serial monitor. 9/28/2020 25
  • 26. Looping Concept //for loop concept Syntax – for(initialization ; condition; increment / decrement) { //code which you want to perform } Example : to print number from 1 to 10 for(int i=1;i<=10;i++) { Serial.println(i); Serial.println(“INDIA”); } 9/28/2020 26
  • 27. long int Count=0; void setup( ) { pinMode(12, OUTPUT); //Initialize the digital pin as output Serial.begin(9600); Serial.println(“count of iterations running are: “); } void loop( ) { for (int i=1;i<=10;i++) { Serial.println(i); digitalWrite(12, HIGH); Serial.println(“ON”); delay(1000); // wait for a second digitalWrite(12, LOW); – Serial.println(“OFF”); delay(1000); // wait for a second } Count++; – Serial.print(“Iteration:”); Serial.println(Count); }9/28/2020 27
  • 28. Condition Statements if(Condition 1) { //Statements } if(Condition 2) { //Statements } else { //Statements } 9/28/2020 28
  • 29. Topic Learning Outcomes At the end of the topic the student should be able to 1. Explain the importance of platform based development 2. Use looping, delay and conditioning concepts in developing a program on Arduino environment. 9/28/2020 29