You are on page 1of 27

1

Embedded System
LAB 1

INTRODUCTION TO ARDUINO

Didam Ahmed
Introduction
2

 Arduino is a tiny computer that you can program to


process inputs and outputs going to and from the chip.

 The Arduino is a Physical or Embedded Computing


platform.

 which means that it is an interactive system, that


through the use of hardware and software can interact
with itʼs environment.
Why Arduino?
3

 Inexpensive

 Cross-Platform

 Simple Programming Environment

 Open source Hardware and Software


Types of Arduino
4

 Arduino Uno
 The most common version of Arduino is the Arduino Uno.

 Arduino Mega 2560 

 Arduino NG, Diecimila, and the Duemilanove (Legacy Versions)

 Arduino Mega ADK

 Arduino LilyPad
Types of Arduino
5
What can it do
6

 Sensors ( to sense stuff )


 Push buttons, touch pads, tilt switches.

 Variable resistors (eg. volume knob / sliders)

 Photo resistors (sensing light levels)

 Thermistors (temperature)

 Ultrasound (range finder)

 Actuators ( to do stuff )
 Lights, LED’s

 Motors

 Speakers

 Displays (LCD)
Arduino Uno
7
Arduino Uno
8
IO Pins
9
Terminology
10
Arduino Programming
11

 The open-source Arduino software (IDE) makes it easy to


write code and upload it to the board. It turns on
windows, Mac OS X, and Linux.
Select Serial Port
12
Select Board
13
Using Arduino
14
Serial Communication
15

 Compiling turns your program into binary data (ones and zeros)

 Uploading sends the bits through USB cable to the Arduino

 The two LEDs near the USB connector blink when data is transmitted or
received

 RX blinks when the Arduino is receiving data


 TX blinks when the Arduino is transmitting data
Arduino Programing
16

 The Arduino language is CASE SENSITIVE:


 a capital letter is not the same as a lower case letter.
 The following code represents the minimum in order
for a program to compile:
Arduino Programing
17

 “void setup()” section is widely used to

 initialize variables, pin modes,


 set the serial baud rate and related.
 The software only goes though the section once.
  “void loop()” section is the part of the code that
loops back onto itself and is the main part of the
code.
Common basic functions
18

 pinMode(pin, mode)

 Designates the specified pin for input or output

 digitalWrite(pin, value)

 Sends a voltage level to the designated pin

 digitalRead(pin)

 Reads the current voltage level from the designated pin


Code Structure
19
Code Structure
20
Code Structure
21
Breadboard
22

 Breadboards are a simple and useful way to quickly


assemble and play around with different circuits.
 Building circuits with a breadboard is as simple as
sticking wires and components into the holes.
 The holes themselves are connected according to
the diagram
Breadboard Connection
23
Breadboard Connection
24

No Connection
LED Circuit
25
Blink Project
26
LED PROJECT
27

You might also like