Correct Answers Graded A+ | Latest 2026\2027
Version
what's the difference btwn analogRead() and analogWrite()
-Correct Answer-analogWrite() uses any PWM pin and creates a square wave that is
read using pulseIn
analogRead() reads a voltage from the analog pins only and returns an integer value
btwn 0 and 1023
"Since our microcontroller's ADC (analog-to-digital converter) has 10 bits of resolution, it
can only represent 10 different states." Is this statement true?
-Correct Answer-No, because the analog-to-digital converter can actually quantize an
analog signal into 1024 different values, allowing it to represent more than just 10
different states
What is quantization?
-Correct Answer-the procedure of constraining something from a continuous set of
values (such as the real numbers) to a relatively small discrete set (such as the
integers).
what is the reference voltage?
-Correct Answer-what determines what will be the maximum voltage we are expecting
(ours is 5V)
Why would you want to change the reference voltage?
-Correct Answer-if by chance you have an ADC that is higher or lower in bits, then you
would want to change the reference voltage to a value higher or lower depending on
what is appropriate
What's a potentiometer?
-Correct Answer-an electrical device that divides variable voltages
What is baud rate?
-Correct Answer-the number of bits that are being transferred per second
What does the map() function look like?
-Correct Answer-map(value, fromLow, fromHigh, toLow, toHigh)
, what does the constrain() function look like?
-Correct Answer-constrain(value, min, max)
Why do we need to add a parallel diode to our DC motor (or inductive loads in general)?
-Correct Answer-We need to add them so that the reverse voltage does not exceed the
forward voltage and damage anything
How is PWM is used to vary the speed of a DC motor?
-Correct Answer-By instructing a PWM-capable pin on the board to send varying duty
cycle signals to the transistor, current flow through the motor rapidly starts and stops
resulting in a change in the motors speed
What is a half-H-Bridge? What can it do?
-Correct Answer-A half H-bridge is an H-Bridge with about half the switches/resistors; It
can apply power to the DC motor as needed but because it only has two switches and
not four, it cannot change the spinning direction of the motor
What's the frequency (in Hz) of a periodic signal with a period of 100ms?
-Correct Answer-take 1/0.1 seconds (100ms) and you will get an answer of 10Hz
What's the difference btwn a digital and analog input?
-Correct Answer-Digitial inputs can take just high/low signals (1/0); just inputs that the
board and computer can understand
Analog input can take multiple numbers of values; inputs/values that we can understand
ourselves
for (int i = 100; i <= 110; i = i+2) {...}. What are the values that i will take on as this loop
executes How many times will the loop run?
-Correct Answer-The values that it will take on are 100, 102, 104, 106, 108, and 110.
The loop will therefore run a total of 6 times
How many bits does a boolean variable take up in memory?
-Correct Answer-8 bits
What's a square wave?
-Correct Answer-a signal that switches on and off (1/0 or up and down)
What is the frequency (in Hz) of a PWM signal produced using analogWrite(3, 100)?
-Correct Answer-the default frequency is 490Hz (unless using pins 5 and 6)