1.2 Arduino Introduction
1.2 Arduino Introduction
• Introduction
• Components
• IDE Tool
• IDE Interface
• Coding Structure
• Coding Syntax
Introduction
• Embedded Systems
• Arduino Basics
• Arduino Architecture
• Arduino board layout. What are the resources available
• Arduino IDE
• Programming fundamentals
3
Components
Arduino Uno
1. Power In (Barrel Jack): Can be used with either a 9V or 12V wall-wart or battery
2. Power In (USB Port): Provides power and communicates with your board when plugged
into your computer via USB.
3. LED (RX: Receiving): Lights up when the Arduino is receiving data (such as when being
programmed).
4. LED (TX: Transmitting): Lights up when your Arduino is transmitting data (such as
when running a program).
Components
5. LED (Pin 13: Troubleshooting): LED is incorporated into your sketch to show if your
program is running properly.
6. Pins (ARef, Ground, Digital, Rx, Tx): Used for inputs, outputs, power, and ground.
8. Reset button: Used to manually reset Arduino, which makes code restart.
9. ICSP Pins: For “in-circuit serial programming,” used if you want to bypass the
bootloader.
10. Pins (Analog In, Power In, Ground, Power Out, Reset): Used for inputs, outputs,
power, and ground.
Components
Arduino Basics
arduino ( arrr-dween-oh )
Arduino Nano
Arduino Mega
Arduino LilyPad
Arduino Uno
Arduino Mini
Arduino Leonardo
Components
Arduino Uno
Digital pins:
• 14 digital IO pins
• 6 are PWM pins (3, 5, 6, 9, 10, and 11).
Analog pins:
• 6 analog pins(A0, A1, A2, A3, A4, and
A5)
• Takes analog values as an input
Components
IDE Tool
Arduino IDE
VERIFY SERIAL
MONITOR
UPLOAD
NEW TAB
OPEN CODE GOES
SAVE HERE
BOARD &
SERIAL PORT
SELECTIONS
Interfaces – IDE Tool
arduino.cc/en/main/software
Interfaces – IDE Tool
New:
Open-up a
new code
window tab.
IDE Interfaces
Save: Saves
the currently
open sketch.
IDE Interfaces
Serial Monitor:
Opens a window that
displays any serial
info the Board is
transmitting. Very
useful for debugging.
What is Serial?
Process of sending
data one bit (0 or
1) at a time.
IDE Interfaces
Sketch
Name: Name of
the sketch you are
currently working
on.
IDE Interfaces
Code Area:
Area where you
compose the code
for your sketch.
IDE Interfaces
Message
Area: Where
the IDE tells you
if there were any
errors in your
code.
Coding Structure
4
Coding Structure
▪ pinMode() ▪ digitalRead()
• Instruction used to set the mode (INPUT or • Reads the value from a specified digital pin,
OUTPUT) in which we are going to use a either HIGH or LOW
pin.
• Eg: int inPin=7;
• Eg: pinMode (13, OUTPUT);
val = digitalRead(inPin);
• ie. setting pin13 as output. • ie. reads the value from inPin and assigns it to
val.
▪ digitalWrite() ▪ delay()
• Write a HIGH or a LOW value to a digital • Pauses the program for the amount of time (in
pin. milliseconds) specified as a parameter.
• Eg: digitalWrite (11, HIGH); • Eg: delay(1000);
• ie. setting pin 11 to high. • ie. waits for a second (1000 ms = 1 s)
29
V
Thank You!