You are on page 1of 11

3/18/2019

EMBEDDED SYSTEMS

CHAPTER THREE
ARDUINO PROGRAMMING
Al-Hussein Bin Talal University
Faculty of Engineering
Department of Computer Engineering
Spring 2019

Dr. Moath Alsafasfeh

John L. Hennessy & David A. Patterson, Computer Architecture a Quantitative Approach 5th Edition, Elsevier

What is an Arduino?

■ Arduino is an open source singleboard-based microcontroller. It is a very popular


platform forked from the Wiring platform and firstly designed to popularize the use
of electronics in interaction design university students' projects.
■ It is based on the Atmel AVR processor and provides many inputs and outputs in only
one self-sufficient piece of hardware.
■ The project was started in Italy in 2005 by founders Massimo Banzi and David
Cuartielles. Today it is one of the most beautiful examples of the open source
concept, brought to the hardware world and being often used only in the software
world.

1
3/18/2019

What is an Arduino?

■ today we can count around 15 boards 'Arduino-based‘.


■ The main differences between those boards are the:
– Type of processor
– Number of inputs and outputs
– Form factor
■ Some Arduino boards are a bit more powerful, considering calculation speed, some
other have more memory, some have a lot of inputs/outputs (check the huge
Arduino Mega), some are intended to be integrated in more complex projects and
have a very small form factor with very few inputs and outputs.
■ “each one can find his friend in the Arduino family”

Arduino Family

■ we can use the same Integrated Development Environment (IDE) on our computers
with any of those boards.
■ Please, check these models:
– Arduino Uno is the basic one with a replaceable chipset
– Arduino Mega, 2560 provides a bunch of inputs and outputs
– Arduino LilyPad, is wearable as clothes
– Arduino Nano, is very small

2
3/18/2019

Arduino Family

Hardware Prototyping
■ We can program and build software quite easily today using a lot of
open source frameworks for which you can find a lot of helpful
communities on the Web.
■ Arduino appeared and changed everything in the landscape by
proposing an inexpensive and all-included solution, a cross-platform
toolchain running on Windows, OS X, and Linux.
■ a very easy high-level C language and library that can also tweak the
low-level bits, and a totally extensible open source framework.
■ Hardware prototyping became (almost) as easy as software
prototyping because of the high level of integration between the
software and the hardware provided by the whole framework.

3
3/18/2019

prototyping cycle.

Arduino software
architecture

4
3/18/2019

Installing Arduino development environment (IDE)

■ find the compressed file downloaded from http://arduino.cc/en/Main/Software.


■ you only have to download it,
■ decompress it somewhere on your system,
■ launch it and JAVA will execute the program.
■ In Windows, let's click on the .exe file included in the uncompressed folder.

What does
the IDE
look like

5
3/18/2019

What does the IDE include?

Tools Menu

6
3/18/2019

Tools Menu

Installing drivers for Arduino

■ When you connect the board, Windows should initiate the driver installation process.
■ You can check that the drivers have been installed by
– opening Windows Device Manager (in the Hardware tab of the System control
panel).
– Look for a USB Serial Port in the Ports section; that's the Arduino board.

7
3/18/2019

Breadboards

Arduino Mega

8
3/18/2019

Fritzing Tool

Start Your Program

9
3/18/2019

Start Your Program

void setup() {
}
■ The first one (setup()) is a function that is executed only one time when the Arduino
board is started (or reseted); this is the place where we are telling the board that the
pin where the LED is connected is an output, that is, this pin will have to drive
current while activated.

10
3/18/2019

void loop(){
}
■ The second one (loop()) is a function executed infinitely when the Arduino board is
supplied. This is the main part of our code in which we can find the steps we wanted
to light up the LED for 250 ms and switch off the LED for 1 s, repeatedly.

11

You might also like