Professional Documents
Culture Documents
What Is An Arduino?: Embedded Systems Chapter Three Arduino Programming
What Is An Arduino?: Embedded Systems Chapter Three Arduino Programming
EMBEDDED SYSTEMS
CHAPTER THREE
ARDUINO PROGRAMMING
Al-Hussein Bin Talal University
Faculty of Engineering
Department of Computer Engineering
Spring 2019
John L. Hennessy & David A. Patterson, Computer Architecture a Quantitative Approach 5th Edition, Elsevier
What is an Arduino?
1
3/18/2019
What is an Arduino?
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
What does
the IDE
look like
5
3/18/2019
Tools Menu
6
3/18/2019
Tools Menu
■ 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
9
3/18/2019
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