Sie sind auf Seite 1von 31

Robotics and

Embedded System
Week 2
OPENING PRAYER

Dear Lord, we offer this gathering to you and we ask


you to bless us with your wisdom and with you grace.
We thank you for this opportunity to be together,
to grow to your love, to service of you by loving each
other.
AMEN.

2
At the end of this discussion, students will be able to:

▪ Discover the different types of Arduino boards


and shields.
▪ Learn about the breakout boards.
▪ Become familiar with the Arduino
development environment.
▪ Code using the Arduino programming
language and troubleshoot errors.

3
ARDUINO
The Arduino is an open-source
DEVELOPMENT platform for rapidly and easily getting
BOARD started in embedded systems. It is
composed of an Arduino board and the
Arduino development environment. You
write programs in the development
environment on your computer, then
transfer this program using the
development environment over to the
Arduino board, where components and
shields can be connected to allow for
more functionality.

4
OPEN-SOURCE The idea behind open-source
hardware is to allow other people the
chance to look at the inner workings –
the source code – of the software and
modify it or adapt it if they have the
ability and time to do so.
Arduino boards can be used
with both IBM-compatible and Apple
computers. Simply download the Arduino
IDE from the Arduino website, then
choose the installers that are specific to
your operating system.

5
There are many shapes and
sizes of Arduino and Arduino-
compatible boards out in the
market. However, there are four
key-shapes and sizes – so called
form-factors.
TYPES OF
6
ARDUINO BOARDS
ARDUINO UNO
The Arduino Uno is the entry-
level board you can play with. Its size
allows easy connections by hand or by
slotting in shields on top of the board.
Currently, the Arduino Uno offers a
surprisingly reasonable space of 32Kb
for storing programs, and allows up to 20
hardware connection points.

7
ARDUINO MEGA
If you find the program space
lacking, or need more hardware
connections, the Arduino Mega offers
three times the connectivity. Most
shields that work with the Arduino Uno’s
form factor would easily work on top of
the Arduino Mega.

8
ARDUINO MICRO If you want to slip the Arduino
into something smaller, the Arduino
Micro comes in in under two inches long
and three-quarters of an inch wide. It
comes packed with more connectivity
options than Arduino Uno, allowing you
to make your own USB devices.
However, its size and shape mean that
the commonly available shields for the
Arduino are not compatible with the
Arduino Micro.

9
ARDUINO GEMMA

If you want to create a wearable


computing devices, the Arduino Gemma
offers an interesting and challenging
platform, while retaining the ease of
developing programs for it.

10
SHIELDS
The Arduino Uno and Mega are
laid out such that you can slip on
additional features to these boards.
Arduino shields are designed to be
stacked on top of the Arduino (and
sometimes, other shields) to provide
such features as WiFi, Bluetooth, or the
ability to control motors and the like. This
will be discussed further in the a later
chapter.

11
BREAKOUT
BOARDS
If the Arduino is a development
board for the Atmel microcontroller, a
breakout board is a development board
for various peripherals that are not on a
shield. Many sensors and output devices
that are almost impossible to wire by
hand come in a form that is easier to
work with.

12
“Hello
World!”
Since the Arduino (and most
embedded systems for that matter) do
not have a screen connected to them,
you need a low-tech way to show that
your program works: make a small
light ON and OFF.

13
Make sure you type exactly as you see the code written above. The
language is case-sensitive, meaning pinMode and PinMode are two different
things.
14
TROUBLESHOOTING
The board was not found. The
message is Problem uploading to
board. If this is the case, check the
board type and serial port again. Try
removing and plugging the board again.
If possible, swap cables or try a different
board. If it does not resolve the issue,
you may gave to check if the correct
device drivers were installed.

15
TROUBLESHOOTING

The program is incorrect. This


is called a syntax error, and the
development environment could not
understand a part of what you have
written. Double-check that you have
typed in the correct spelling,
capitalization of letters, and punctuation
symbols for the code.

16
1. Make sure you have exactly one void
loop ( ) function and exactly one void
TROUBLESHOOTING setup ( ) function.

2. Check that the braces ( { } ) and


parentheses are matched, ie. one
opening brace matched with a closing
brace. In the Arduino Development
Environment, clicking on one brace will
enclose its matching brace in a blue
rectangle.

3. Later on when you are using


variables, make sure that these start with
a letter and be consistent in the
17
capitalization.
UNDERSTANDING
THE CODE
Arduino is based on Wiring
development environment, which
fundamentally simplifies the actual
C++ language it uses. If you know how
to write a program in C, C++, C#, Java,
or any other language influenced by C,
you should be familiar with how to
write for the Arduino.
18
The term function is similar to the mathematical definition. For instance,
if you have a function f(x) = 2x, this means your function f( ) takes in the value x
(called parameter or argument) and returns twice x (called the return value). In the
cases of setup ( ) and loop ( ) above, they take no values (nothing between the
parentheses), nothing happens inside them (nothing between the brackets_), and
they return no values (the term void before the name of the function.
19
When an Arduino is powered on or restarted, it will perform tasks in the
setup ( ) function first. Normally, these would be for configuring the various
hardware connections or pins as needed – things you would want to perform once,
and only at the beginning. With Hello World!, you told the Arduino to make digital
pin #13 deliver output using the built-in function pinMode ( ) . Digital pin #13 so
happens to have a small indicator lamp built into the Arduino board.

Here, the terms input and output are from the perspective of the Arduino.
An output is any signal being sent out from the Arduino, while an input is any
signal into the Arduino.
20
After completing all the tasks listed inside the setup ( ) function, the
Arduino then executes the statements in the loop ( ) function. This function will
keep on running for as long as the Arduino is powered and does not malfunction.
Let’s look at the loop function for Hello World!

The built-in function digitalWrite ( ) sends a signal to a digital pin. In your


code, signaled digital pin #13 HIGH first, then signaled it LOW after. Because this
is in the loop ( ) function, these four lines of code will repeat in the order you wrote
them.
21
TOOLS
22
LED (LIGHT EMITTING
DIODE)

▪ is a semiconductor
device that emits visible
light when an electric
current passes through
it.

23
SCHEMATIC SYMBOL

24
RESISTORS

▪ are electronic
components which have
a specific, never-
changing electrical
resistance.

25
BREADBOARD

▪ is a solderless device
for temporary prototype
with electronics and test
circuit designs.

26
RESISTORS

▪ HAS NO POLARITY

27
SCHEMATIC SYMBOL

28
JUMPER WIRES

▪ are simply wires that


have connector pins at
each end, allowing them
to be used to connect
two points to each other
without soldering.
29
GROUP WORK
ASSIGNMENT

▪ 3 HARDWARE (CIRCUIT MAKERS)


▪ 2 SOFTWARE (PROGRAMMERS)
▪ 2 SECRETARY (DESIGN AND
DOCUMENTATIONS)
▪ 2 IN-CHARGED IN MATERIAL HANDLING
▪ 1 GROUP LEADER
30
End of presentation.

Any questions?

31

Das könnte Ihnen auch gefallen