ARDUINO

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 28

BASICS OF ARDUINO,

PROGRAMMING BASICS
AND TYPES

By
Dr.S.Vijayakumar
Dept of ECE/SITAMS
Topics of Interest
• What is Arduino
• Getting to know Arduino
• Types of inputs and outputs
• How does Arduino work
• Understand the programming of Arduino
board.
What is arduino
Simple to use “open source” electronic hardware
that contains:
• Controlling electronic chip( microcontroller)
• Standardized hardware
• Connections that are simplified for every body
What is a Development Board
• A printed circuit
board designed to
facilitate work with a
particular
microcontroller.
• Typical components include:
• power circuit
• programming interface
• basic input; usually buttons and LEDs
• I/O pins
The Arduino Development Board

Making-robots-with-arduino.pdf
What can an Aurdino do
• Interface with motor
• Interface with LED
• Interface with resistive touch i,e touch input
from finger.
• Display character “HELLO WORLD”
• Car motor controls using AURDINO
• Interface ZIGBEE and RFID.
The Arduino Microcontroller: Atmel
Atmega 328
ATmega328/P
• ATmega328/P is a low-power 8-bit
microcontroller based on the RISC architecture.
• By executing powerful instructions in a single
clock cycle, the ATmega328/P achieves
throughputs close to 1MIPS per MHz.
• 131 Powerful Instructions
• Most Single Clock Cycle Execution
• 32 x 8 General Purpose Working Registers
• Up to 20 MIPS Throughput at 20MHz
Additional features
• 32KBytes of In-System Self-Programmable Flash
program Memory.
• Two 8-bit Timer/Counters
• One 16-bit Timer/Counter
• One Programmable Serial USART
• Power-on Reset and Programmable.
• Internal Calibrated Oscillator
• External and Internal Interrupt Sources
• IDLE MODE , Standby modes
contn
• 28-pin PDIP
• Operating Voltage: 1.8 - 5.5V
• Speed Grade:
0 - 4MHz @ 1.8 - 5.5V
0 - 10MHz @ 2.7 - 5.5V
0 - 20MHz @ 4.5 - 5.5V
• Active Mode: 0.2mA
• Power-save Mode: 0.75μA
What is the Arduino
Getting Started
1. Download & install the Arduino environment (IDE)
2. Connect the board to your computer via the USB
cable
3. Launch the Arduino IDE
4. Select your board
5. Select your serial port
6. Write an example
7. Upload the program
Try It: Connect the USB Cable
Arduino IDE
Select Serial Port and Board
Status Messages
Add an External LED to pin 13

• File > Examples > Digital > Blink


• LED’s have polarity
– Negative indicated by flat side of the housing
and a short leg
A Little Bit About Programming
• Code is case
sensitive
• Statements are
commands and
must end with a
semi-colon
• Comments follow a
// or begin with /*
and end with */
• loop and setup
Our First Program
Terminology
Digital I/0

pinMode(pin, mode)
Sets pin to either INPUT or OUTPUT
digitalRead(pin)
Reads HIGH or LOW from a pin
digitalWrite(pin, value)
Writes HIGH or LOW to a pin
Arduino Timing

• delay(ms)
– Pauses for a few milliseconds
• delayMicroseconds(us)
– Pauses for a few microseconds
Digital? Analog?
• Digital has two values: on and off
• Analog has many (infinite) values
• Computers don’t really do analog, they quantize
• Remember the 6 analog input pins---here’s how
they work
Putting It Together
• Complete the sketch
(program) below.
• What output will be
generated by this program?
• What if the schematic were
changed? 

You might also like