Homework #10

ukrainianlegalΗλεκτρονική - Συσκευές

2 Νοε 2013 (πριν από 3 χρόνια και 7 μήνες)

107 εμφανίσεις

EGR 120

Introduction to Engineering

File: N120H10A


Homework #10

Arduino
-
BOT Worksheet


The purpose of this assignment is to help the student become familiar with the
Arduino
-
BOT robot and the
Arduino programming language. Background information
for the

assignment can be found using the following
resources
:

1)

Arduino
-
BOT Lecture #1
-

http://faculty.tcc.edu/PGordy/Egr120/


2)

Robotics with the Board of Education Shield for Arduino web tutorials
-

http://learn.parallax.com/ShieldRobot


3)

Board of Education Shield for Arduino documentation
-

http://w
ww.parallax.com/Portals/0/Downloads/docs/prod/robo/35000
-
BOEShield
-
v1.2.pdf


4
)

Arduino web site (software, microcontrollers, examples, and more)
-

http://www.arduino.cc/


























Part A: (28 pts)
Matching



Place the correct letter (A


N) next to each term below:


Term

Letter


Term

Letter

Reset Button



Jumper for 5V or Vin connection to servos


Power Indicator Light

for
breadboard (Switch position 1)



Power Indicator Light for breadboard and
servos (Switch position 2)


Breadboard



Header
s

for digital inputs


3.3V Regulator



Header for 3.3V, Vin, and 5V


5V Regulator



Headers for power and analog inputs


On/Off Switch



Header for analog inputs and ground


Connection Port for Servos



Mounting Hole


A

B

C

D

E


F

G

J

K

L

I

H

N

M


Part B: (40 pts)
Multiple Choice



Circle the letter corresponding to the best answer in each part.


1.

The BOE Arduino Shield supports each of the
Arduino microcontrollers listed below except:

a) Arduino UNO


b)
Arduino Duemilanove

c)
Arduino Micro

d)
Arduino Mega



2.

The
BOE Arduino Shield provides
how many
digital

input/output pins?

a) 5

b) 6

c) 13

d) 1
4

e)
16



3.

Which of the digital
input/output pins are used for serial communications via the USB cable?

a)
Pins 0 and 1

b)
Pins 1 and 2

c)
Pins 12 and 13


d)
Pins 0
-
13

e) none of the above



4.

The BOE Arduino Shield provides how many
analog

input pins?

a) 5

b) 6

c) 13

d) 14

e)

16



5.

A res
istor with the color bands orange
-
white
-
red
-
gold has what value?

a)
3

k



b)
39 k


c)
2700


d)
3.9 k


e)
390




6.

A resistor with the value 560


and a 10% tolerance has what color bands:

a)

green
-
blue
-
brown
-
gold

b)
violet
-
gray
-
brown
-
silver

c)
green
-
blue
-
brown
-
silver


d)
green
-
blue
-
black
-
gold

e) green
-
blue
-
black
-
silver



7.

The
positive (+) end of a
light emitting diode

is called the:

a) anode


b)
cathode

c)
diode


d)
ground

e)
power pin



8.

Which of the following is not a valid
variable type

in C/C++?

a)
int


b)
real


c)
char


d)
float



9.

Wires can be connected to a digital input by plugging the wire into a connector called a(an):

a)

anode


b)
terminal


c)
header


d)
port


e)

p
lug



10.

Which of the following is not a valid position for the 3
-
position switch on the Board of Education?

a) Power OFF





b)
Breadboard OFF

& Servo Ports ON


c) Breadboard ON &
Servo Ports OFF


d) Breadboard

ON & Servo Ports ON


11.

The
Board of E
ducation Shield for Arduino

is

made by which company?

a) Intel

b) AMD

c) National Semiconductor

d)
Arduino

e) Parallax



12.

The BOE
-
BOT turns its wheels by turning what type of devices?

a) motors


b) stepper motors

c) servos

d) relays

e) gearhea
d motors



13.

Programs are written for the
Arduino are created with the Arduino IDE and have the file extension
:

a)
.ard


b)
.cpp


c)
.ino


d)
.pgm

e)
.exe



14.

The space on the
Arduino
-
BOT

for building circuits is the:

a)

integrated circuit

b)
breadboard


c) connection port

d) serial port


e)

regulator





15.

Arduino programs can be checked for errors by selecting which button?

a) Compile


b
) Validate


c
)
Check

d
)
Assemble

e) Verify



16.

Which of the following is not a sensor?

a) infrared detector

b) accelerometer

c) temperature probe


d) servo


e)

whisker


17.

Arduino programs (sketches) typically call two main functions called:

a)
initialize()

and
loop()


b)
main
()

and
loop()


c)
function
()

and
loop()


d)
setup
()

and
for_
loop
()


e)
setup
()

and
loop()


18.

Comments in
C/C++

programs begin with what character?

a) /

b) //


c) ‘


d) ‘’


e) *


19.

The message “Hello”
can be sent by a
n Arduino
-
BOT

to the computer screen using which command?

a)
Serial.print
ln
(
“Hello”);


b)

Print(“Hello”);


c) Display(“Hello”);

d)
Debug(“Hello”);



e)
DigitalWrite(“Hello”);


20.

Some of the first simple programs using the
Arduinn
-
BOT

involve using the
robot

to turn on and off
a
small
device that gives off light called a(an):

a) bulb


b)

LED


c) LCD


d) CRT


e) resistor



Part C: (32 points)
True/False



Circle T (True) or F (False) in each part below.


1.

T

F

Some servos only turn over a certain angular range (such as

90


to +90

), but the servos in the
BOE
-
BOT have been modified
to turn continuously.


2.

T

F

The
Arduino
-
BOT turns by rotating one servo at a faster rate than the other servo.


3.

T

F

In order for the
Arduino
-
BOT to move forward, one servo needs to turn clockwise and the
other needs to turn counter clockwise.


4.

T

F

The
positive end of an LED is called the
anode
.


5.

T

F

If the USB is connected to the Arduino
-
BOT and new AA batteries are also connected to the
Arduino
-
BOT, the breadboard will be powered from the USB.


6.

T

F

Whether the Arduino
-
BOT uses 4 AA batteries or 5 AA batteries,
the purpose of the
voltage
regulator
s

on the
Arduino
-
BOT
is to produce a steady
3.3V and
5V.


7.

T

F

LED stands for
light emitting device
.


8.

T

F

The

battery connector should be unplugged from the Arduino
-
BOT at the end of each class so
that the batteries are not drained.



9.

T

F

The command
digitalWrite(0, HIGH);


will set
digital
I/O pin
0

to
0V.


10.

T

F

Two wires can be connected together on a
breadboard by plugging them into the same row of 5
holes.


11.

T

F

The
Arduino UNO
is referred to as a
microprocessor

or a
microcontroller
.


12.

T

F

The
Arduino UNO

R3
runs at a speed of
16

MHz and
has 32 kB of flash memory for storing
programs
.


13.

T

F

I
n order to control the brightness of an LED, a
resistor

is connected in series with the LED.


14.

T

F

Programs may be restarted on the
Arduino
-
B
OT by
pressing the Reset button
.


15.

T

F

The Arduino UNO comes with a surface mount LED connected to pin 13 for

testing
.


16.

T

F

The BOE
-
BOT can be steered by turning the ball that serves as its front wheel.