EGR 2800 MOODLE QUIZZES/OLD EXAMS

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

What does the X symbol mean in a truth table?

"don't care"

At what rate will the brightness of the LED be updated?

(every time it loops) =10ms rate=1/.001= 100Hz

Why have we been discouraging the use of float datatypes in class?

- waste of memory - no floating point unit -> large and slow programs

What is the duty cycle of a square wave with a frequency of 0.50 Hz and a pulse width of 0.25 seconds?

1/0.5 Hz= 2 sec. dc= 0.25sec/2 sec x 100

What is the frequency (in Hz) of a periodic signal with a period of 100 milliseconds?

10

What is the RAW ADC reading when 5v are applied to an input channel of the ADC?

1023

What is 0 x 10 in decimal?

16(10)

Using the analogWrite() function, what is the smallest increment that the duty cycle can be changed?

256/100%

delay(30); The code above will cause a delay lasting

30 milliseconds

What is the step-size of a hypothetical 4-bit ADC that accepts and analog voltage between 0 and 3 volts?

3v/(16-1)

The frequency (in Hz) of a PWM signal produced using analogWrite(3, 100) is...

490 Hz

Our Arduino Uno R3 board has how many analog inputs? (enter the raw number only)

6

How many BITS does a boolean type variable take up in memory?

8

Write a line of code to toggle (i.e., flip) all 8 bits of variable A.

A=A^0611111111;

Why was II used instead of I ?

Boolean or only interest in statement T or F

For a DC motor, define "No-load Current" in your own words.

I when spinning freely

A square wave is a signal that...

Is a periodic digital signal that alternates between high and low

The above program calculates and prints out to the serial port

Once in setup (one time) (nothing in loop function)

The function analogWrite() has a misleading name. Explain.

Output is not "analog" it's PWM

Switch debouncing is usually necessary in user interfaces to...

Prevent the microcontroller from interpreting a single button press as multiple presses

Using an RGB LED, three (3) resistors are used, one for each anode. When using only one resistor on the common cathode of the LED instead...

The current flow in each LED will depend on the state of the other two LEDs, meaning that colors will not be mixed accurately.

What is the difference between analogWrite() and digitalWrite()?

analogWrite() = PWM write digitalWrite = 0/1

What parameters would you pass to analogWrite() to have the same effect as digitalWrite(10,HIGH)?

analogWrite(10,255)

What give names to pin namers? In other words, what is the purpose of Lines 1 and 2? Line 1: int led_pin =6; Line 2: int pot_pin =A0;

avoid magic #s

What is the significance of the number 4800 in Line 4? Line 4: Serial.begin (4800) ;

baud rate= comm. speed = 4800 bit/sec

What is the duty cycle of a square wave with a frequency of 10Hz and a positive pulse width (i.e, high time) 0.03 seconds?

dc= 0.03sec/0.01sec x 100= 30

Why do we like linear sensors?

easier math, less execution time/ memory etc.

A POT is a special potassium-based light emitting diode (LED).

false

A full H-bridge is necessary for speed control of a DC motor.

false

Brushed motors typically last longer than brushless motors.

false

In the C programming language, we use ' for inters and " for characters.

false

Printing "\r" to a serial terminal program will result in a new line.

false

Since our microcontroller's ADC (analog-to-digital converter) has 10 bits of resolution, it can only represent 10 different states.

false

The difference between a middle C and a soprano C is the amplitude of the sine wave generating each on a speaker.

false

The map() function maps pins on the Arduino Uno R3 board to internal peripherals.

false

The potentiometer, used in conjunction with the speaker, allows us to fine-tune the frequency of the tone produced.

false

The purpose of the parallel diode is to prevent the motor from turning in the wrong direction.

false

The range of an int is twice as large as that of a char.

false

There is no way to program the microcontroller on the Uno board without using the Uno's USB port.

false

What is the main difference between a while loop and a do-while loop?

free first run with do-while

Define "small torque" of a DC motor

load that stops/stalls motor

What does != mean?

not equal to

Since the potentiometer is a use interface device, is it necessary to use the constrain function to insure that led_value never exceeds 255?

not really

What effect would returning state[2] instead of state[0] in Line 10? Line 10: return state[0];

nothing all are same

What does "boolean" in line 1 indicate? Line 1: boolean digitalRead__debounced(int button__id) {

return type (T or F)

What does the unsigned int in Line 1 indicate? Line 1: unsigned int foo (unassigned byte x)

return type is unsigned int

Provide a line of code that will print out and exclamation mark after the area

serial.print('!');

What is the role of 5 ms delay between readings in the context of debouncing?

to space out samples (in time) to be > worst case bounce time

"Baud Rate" is typically measured in bits/second.

true

"Quantization" refers to the process of mapping a small analog range of values to a discrete digital number.

true

'Mercury Wetting' can be used to denounce switches.

true

0 through 225 can be held in a variable of type unsigned char.

true

A current-limiting resistor (which sets the current flow) is necessary when using an LED.

true

A motor can be turned in one direction with a single transistor. For bidirectional control, however, four transistors are necessary.

true

A potentiometer has three terminals, but only two are necessary to adjust the volume of the produced sound.

true

Although an external programmer can be used, Arduinos are preloaded with a "bootloader" program that allows us to download our programs through a generic USB port.

true

Brushed motors contain brushes.

true

General purpose input/outputs (GPIO) pins need to be set to be an output port in order to drive an LED.

true

In a linear voltage regulator, the input voltage always has to be higher than the desired output voltage and the excess voltage is burned off as heat.

true

In our motor drive chip, the 2 H-Bridges were represented as 4 tri-state buffers.

true

Inductive loads cause voltage spikes that can damage the driving circuitry.

true

Mechanical switches bounce when making contact. They also bounce when breaking contact.

true

Not every function has a return value

true

Our Arduino Uno R3 board actually contains not one, but two ATMega microcontrollers.

true

Our Arduino has a debug LED connected to pin #13.

true

Our Arduino has a debug LED connected to pin 13

true

Power can be supplied to the Arduino through a USB cable or through a barrel jack connector.

true

Serial DB-9 connectors were largely replaced with USB ports on PCs and laptops.

true

Serial.print("\r\n") and serial.print("\n\r") both move the curses to the start of the next line.

true

Standard ASCII characters are actually 7-bit codes (as opposed to 8-bit codes).

true

The Arduino Uno R3 board has two microcontrollers on it.

true

The Arduino Uno board contains two power regulators, one produces 5V and the other produces 3.3V.

true

The Arduino Uno board provides analog as well as digital ports; both types of ports can be used as digital input and output (I/O) ports.

true

The analogReference() function may be used to change the reference voltage.

true

The bootloader resides on our microcontroller and takes up valuable program space

true

The constrain() function allows enforcing minimum and maximum values for a variable.

true

The output of a tri-state buffer can take on one of three possible states.

true

The reference voltage of the ADC (analog-to-digital converter) we will use in this class is 5V, which defines the maximum voltage the ADC can handle.

true

The rotation direction of a DC motor reverses when the applied DC voltage is reversed.

true

The speed of a DC motor can be adjusted using pulse-width modulation (PWM).

true

The tone() function takes three parameters but not all are required.

true

To process data on the Arduino microcontroller, a receive buffer can be checked for the amount of available data using the Serial.available() function and data can be grabbed from the buffer using the Serial.read() function.

true

Transistors can be used as amplifiers, but we only use them as switches when employing pulse-width modulation (PWM) to drive a motor.

true

When using a pull-up resistor with a switch, the switch has to be connected to ground.

true

While digital signals only take on two states, analog signals can take on an infinite number of values within its range.

true

With a servo, pulse-width modulation (PWM) is used, but it does not directly control the power for the servo's motor. Instead, PWM is used to set (encode) a desired angle.

true

for (int i = 100; i <= 1000; i = i + 100); The for loop specified by the above code will run ten (10) times.

true

How many times with Line 6 be executed when this function is called? Line 5: for(i=1;i<=x;i++) {

x times


Ensembles d'études connexes

Chapter 9 Muscular System Part 2

View Set

Lesson 4: Comparing Local Networking Hardware

View Set

MARK3336 Ch. 5 Video: IMG World: Creating the College Experience

View Set