Introduction to Arduino
&
Programming language
By
C. Vamshi Krishna
Department of Electronics & Communication
Engineering
GITAM School Of Technology
GITAM University
Bengaluru Campus
What is arduino?
What is arduino?
 Arduino is an open-source prototyping platform
based on easy-to-use hardware and software.
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.
What is arduino?
 In General, we use the Arduino programming
language (based on Wiring) and the Arduino
Software (IDE), based on Processing.
Why arduino?
 Arduino has been used in thousands
of different projects and applications.
 The Arduino software is easy-to-use
for beginners.
 It runs on Mac, Windows, and Linux.
 Programming language is easy.
Advantages over
microcontrollers
 Arduino boards are relatively inexpensive
compared to other microcontroller platforms.
 The Arduino Software (IDE) runs on Windows,
Macintosh OSX, and Linux operating systems.
Most microcontroller systems are limited to
Windows.
How to start?
1.Check out:
http://arduino.cc/en/Guide/HomePage
2. Download & install the Arduino environment
(IDE)
3.Connect the board to your computer via the USB
cable
4.Install the drivers for arduino board
5.Launch the Arduino IDE
6.Select your board, serial port, processor.
7.Open the blink example
8. Upload the program
Arduino IDE
Selecting arduino board
Selecting the processor
Selecting the serial port
Using the arduino
Example arduino code
Checking the output
 Press the upload button on the top of
the software.
 Open the serial monitor to see the
output.
Status messages
What is arduino
programming? Arduino consists of both a physical
programmable circuit board and a piece of
software, or IDE (Integrated Development
Environment) that runs on your computer, used
to write and upload computer code to the
physical board.
 An open-source hardware platform based on an
Atmel AVR 8-bit microcontroller and a C++
based IDE
 Over 300000 boards have been manufactured
 Arduino Due is based on a 32-bit ARM Cortex
Important functions
 Serial.println(value);
◦ Prints the value to the Serial Monitor on your
computer
 pinMode(pin, mode);
◦ Configures a digital pin to read (input) or
write (output) a digital value
 digitalRead(pin);
◦ Reads a digital value (HIGH or LOW) on a
pin set for input
 digitalWrite(pin, value);
◦ Writes the digital value (HIGH or LOW) to a
pin set for output
How arduino program runs?
 Arduino programs run on two basic sections.
 void setup() {
 //setup motors, sensors etc
 }
 void loop() {
 // get information from sensors
 // send commands to motors
 }
SET UP
 The setup section is used for
assigning input and outputs
(Examples: motors, LED’s, sensors
etc) to ports on the Arduino
 It also specifies whether the device is
OUTPUT or INPUT
 To do this we use the command
“pinMode”
 void setup()
 {
pinMode(9, OUTPUT);
 } Input or
output
port #
void loop() { Port # from setup
digitalWrite(9, HIGH);
delay(1000);
digitalWrite(9, LOW);
delay(1000);
} Wait for 1 second
or 1000 milliseconds
Wait for 1 second
Port # from se
Turn the LED on
or off
How LED blinks?
 void setup()
 {
 pinMode(77, OUTPUT); //configure pin 77
as output
 }
 // blink an LED once
 void blink1()
 {
 digitalWrite(77,HIGH); // turn the LED on
 delay(500); // wait 500 milliseconds
 digitalWrite(77,LOW); // turn the LED off
 delay(500); // wait 500 milliseconds
 }
How to create infinite loops?
void loop() //blink a LED
repeatedly
{
digitalWrite(77,HIGH); // turn
the LED on
delay(500); // wait 500
milliseconds
digitalWrite(77,LOW); // turn
the LED off
delay(500); // wait 500
milliseconds
}
Reading data from arduino
void setup()
{
Serial.begin(9600);
}
void serialtest()
{
int i;
for(i=0; i<10; i++)
Serial.println(i);
}
Aurdino presentation
Aurdino presentation

Aurdino presentation

  • 1.
    Introduction to Arduino & Programminglanguage By C. Vamshi Krishna Department of Electronics & Communication Engineering GITAM School Of Technology GITAM University Bengaluru Campus
  • 2.
  • 3.
    What is arduino? Arduino is an open-source prototyping platform based on easy-to-use hardware and software. 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.
  • 4.
    What is arduino? In General, we use the Arduino programming language (based on Wiring) and the Arduino Software (IDE), based on Processing.
  • 5.
    Why arduino?  Arduinohas been used in thousands of different projects and applications.  The Arduino software is easy-to-use for beginners.  It runs on Mac, Windows, and Linux.  Programming language is easy.
  • 6.
    Advantages over microcontrollers  Arduinoboards are relatively inexpensive compared to other microcontroller platforms.  The Arduino Software (IDE) runs on Windows, Macintosh OSX, and Linux operating systems. Most microcontroller systems are limited to Windows.
  • 7.
    How to start? 1.Checkout: http://arduino.cc/en/Guide/HomePage 2. Download & install the Arduino environment (IDE) 3.Connect the board to your computer via the USB cable 4.Install the drivers for arduino board 5.Launch the Arduino IDE 6.Select your board, serial port, processor. 7.Open the blink example 8. Upload the program
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
    Checking the output Press the upload button on the top of the software.  Open the serial monitor to see the output.
  • 15.
  • 16.
    What is arduino programming?Arduino consists of both a physical programmable circuit board and a piece of software, or IDE (Integrated Development Environment) that runs on your computer, used to write and upload computer code to the physical board.  An open-source hardware platform based on an Atmel AVR 8-bit microcontroller and a C++ based IDE  Over 300000 boards have been manufactured  Arduino Due is based on a 32-bit ARM Cortex
  • 17.
    Important functions  Serial.println(value); ◦Prints the value to the Serial Monitor on your computer  pinMode(pin, mode); ◦ Configures a digital pin to read (input) or write (output) a digital value  digitalRead(pin); ◦ Reads a digital value (HIGH or LOW) on a pin set for input  digitalWrite(pin, value); ◦ Writes the digital value (HIGH or LOW) to a pin set for output
  • 18.
    How arduino programruns?  Arduino programs run on two basic sections.  void setup() {  //setup motors, sensors etc  }  void loop() {  // get information from sensors  // send commands to motors  }
  • 19.
    SET UP  Thesetup section is used for assigning input and outputs (Examples: motors, LED’s, sensors etc) to ports on the Arduino  It also specifies whether the device is OUTPUT or INPUT  To do this we use the command “pinMode”
  • 20.
     void setup() { pinMode(9, OUTPUT);  } Input or output port #
  • 21.
    void loop() {Port # from setup digitalWrite(9, HIGH); delay(1000); digitalWrite(9, LOW); delay(1000); } Wait for 1 second or 1000 milliseconds Wait for 1 second Port # from se Turn the LED on or off
  • 22.
    How LED blinks? void setup()  {  pinMode(77, OUTPUT); //configure pin 77 as output  }  // blink an LED once  void blink1()  {  digitalWrite(77,HIGH); // turn the LED on  delay(500); // wait 500 milliseconds  digitalWrite(77,LOW); // turn the LED off  delay(500); // wait 500 milliseconds  }
  • 23.
    How to createinfinite loops? void loop() //blink a LED repeatedly { digitalWrite(77,HIGH); // turn the LED on delay(500); // wait 500 milliseconds digitalWrite(77,LOW); // turn the LED off delay(500); // wait 500 milliseconds }
  • 24.
    Reading data fromarduino void setup() { Serial.begin(9600); } void serialtest() { int i; for(i=0; i<10; i++) Serial.println(i); }