EGR 2800 - ECE Portion (Cumulative Update Throughout Semester)

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/80

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 5:32 AM on 5/16/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

81 Terms

1
New cards

Another name for a microcontroller

Small Computer System on Chip (SoC)

2
New cards

What makes up the Small Computer System on Chip (SoC)?

–a microcontroller, microprocessor or digital signal processor (DSP) core(s)

–memory blocks including a selection of ROM, RAM, EEPROM and flash memory

–timing devices: oscillators, phase-locked loops, counter-timers, real-time timers

–external interfaces: USB, Ethernet, USART, SPI, I2C communication

–Analog to Digital Converters (ADC) and Digital to Analog Converters (DAC)

–voltage regulators and power management circuits

3
New cards

Central Processing Unit (CPU)

The main component of a computer that performs calculations, executes instructions, and manages data flow within the system. It is often referred to as the brain of the computer.

4
New cards

Bootloader

A small program that initializes the hardware and loads the operating system or application into memory during the startup process.

5
New cards

What is the bootloader doing when it runs for a few seconds before startup?

–watches for IDE communication for downloading new code

–If no IDE present, the previous program will be executed

6
New cards

What is a alternative to using a bootloader

an in circuit programming pod, known as an ICSP (In-Circuit Serial Programmer)

7
New cards

GPIO Pin

General Purpose Input/Output Pin

8
New cards

General Purpose Input/Output Pins

  • - pins can be configured as inputs or outputs

  • ■ This is typically declared in a startup procedure.

  • ■ Input values are readable. This are typically digital or a Boolean where 1 is a logical high and 0 is a logical low.

  • ■ Output values are writable and readable.

  • ■ have 5 V tolerant inputs without damage even when the device operates off of 3.3 V. Make sure you know the voltage levels that your device can accept. Sometimes you need to employ a logic level shifter to protect you devices.

9
New cards

What Arduino pin controls the yellow onboard LED

13

10
New cards

What does PWM stand for?

Pulse Width Modulation

11
New cards

Boolean Variable

Holds 2 values, TRUE (1) or FALSE (0)

12
New cards

How much memory does a boolean take up?

1 byte (8 bits)

13
New cards

char Variable

Stores a character value

14
New cards

How much memory does the data type char take up?

1 byte (8 bits)

15
New cards

How much memory does int variable take up?

2 bytes (16 bits)

16
New cards

What range of values does the int variable hold?

-2^15 to (2^15)-1

17
New cards

How much memory does the unsigned int variable take up?

2 bytes (16 bits)

18
New cards

What range of values does the unsigned int variable hold?

0 to (2^16)-1

19
New cards

How much memory does the long variable take up

4 bytes (32 bits)

20
New cards

What range of values does the long variable hold?

-2,147,000,000 to 2,147,000,000

21
New cards

Unsigned int data type

Does not store any negative values

22
New cards

How much memory does unsigned long data type store

4 bytes (32 bits)

23
New cards

What range of values does the unsigned long datatype hold?

0 to (2^32-1)

24
New cards

Float data type

Decimal number values

25
New cards

How much memory does a float hold?

4 bytes (32 bits)

26
New cards

What range of values does the float data type hold?

-3.4×10^38 to 3.4×10^38

27
New cards

How much memory does a double take up?

4 bytes (32 bits)

28
New cards

TRUE or FALSE: float and doubles are the same thing

TRUE

29
New cards

Duty Cycle Formula

dc = (T high) / (Period) * 100%

30
New cards

Digital to Analog Converter (DAC)

Used to produce a accurate analog voltage between 0-5 V

31
New cards

What is used in lieu of a digital to analog converter?

PWM

32
New cards

What are examples of how PWM is used to vary voltage?

  1. Vary LED brightness

  2. Vary the speed of a DC motor

33
New cards

What frequency of PWM signals is produced?

490 Hz except for pins 5 and 6 which are 980 Hz

34
New cards

What are the PWM pins

3, 5, 6, 9, 10, and 11

35
New cards

Bitwise AND Operator

&

36
New cards

Bitwise OR Operator

|

37
New cards

Bitwise XOR Operator

^

38
New cards

Bitwise NOR Operator

~

39
New cards

Boolean AND Operator

&&

40
New cards

Boolean OR Operator

||

41
New cards

Boolean XOR Operator

!=

42
New cards

Boolean NOT Operator

!

43
New cards

What type of operators are used to manipulate bits?

Bitwise

44
New cards

What type of operators are used in conditional statements (if, while, for)

Boolean

45
New cards

Local Variable

Variable declared INSIDE a function or block

46
New cards

Global Variable

Declared OUTSIDE of all functions (usually at top of code)

47
New cards

Function Call Format

k = function(i,j);

48
New cards

while loop

Checks the condition BEFORE running the loop body. If the condition is false at the start, the body may not run at all.

49
New cards

do-while loop

Runs the loop body FIRST, then checks the condition. This means the body will ALWAYS RUN AT LEAST ONCE, even if the condition is false from the beginning

50
New cards
term image

Pulldown Resistor

51
New cards
term image

Pullup Resistor

52
New cards

Pulldown Resistor

Resistor is directly connected to ground

53
New cards

Pullup Resistor

Resistor is directly connected to power

54
New cards

What are pullup and pulldown resistors used for?

Are needed to prevent the microcontroller unit input from floating

55
New cards

Give a example of a sensor that provides digital input

A button (ON = TRUE(1) and OFF=FALSE(0))

56
New cards

Give a example of a sensor that provides analog input

A thermistor/temp sensor which changes voltage based on a range of temperature values

57
New cards

What is a bootloader?

A small program stored in a microcontroller that starts a device and loads the main program when power turns on

58
New cards

What are two ways to power the arduino board?

  1. USB Cord

  2. Vin / 5V Arduino Pins

59
New cards

The GPIO pins on your board are configured as input by default. Why?

To prevent damage to the board when first powering on

60
New cards

Why would you want to debounce a button?

It allows you to avoid the button from looping multiple times on accident after the button is pressed due to electrical noise

61
New cards

What is a potentiometer?

A resistor that lets you change the resistance values by turning a knob which changes the output voltage

62
New cards
<p>Suppose you have the following problematic circuit. What is the digital value of PIN 2 when the button is pressed?</p>

Suppose you have the following problematic circuit. What is the digital value of PIN 2 when the button is pressed?

The value is HIGH (1)

63
New cards
<p>Suppose you have the following problematic circuit. What is the digital value of PIN 2 when the button is NOT pressed?</p>

Suppose you have the following problematic circuit. What is the digital value of PIN 2 when the button is NOT pressed?

The value will either be HIGH or LOW since the pin is floating (its disconnected from 5V and also not connected to ground) and is unstable

64
New cards
<p>Suppose you have the following problematic circuit. How would you fix the problematic circuit?</p>

Suppose you have the following problematic circuit. How would you fix the problematic circuit?

Need to add a pull-down resistor between PIN22 and GND

65
New cards

MEMS Capacitive Accelerometer

Detects movement and acceleration by measuring changes in capacitance

66
New cards

Gyroscope

Measures the angle of a piece of hardware

67
New cards

Thermistor

Detects changes in temperature and uses that to change the resistance values

68
New cards

Photoresistor

Detects changes in the amount of light and uses that to change the resistance values

69
New cards

Equation used to calculate how many values a ADC represents

# of Values = 2^(# of bits)

70
New cards

How many values can a 10 bit ADC represent?

Num of Values = 2 ^ (# of bits) = 2^10 = 1,024 Values

71
New cards

How many bits does a boolean variable take up in memory?

1 byte (8 bits)

72
New cards
<p>Consider the code. Is the variable x on line 14 a local or global variable?</p>

Consider the code. Is the variable x on line 14 a local or global variable?

Global since its written as x*=k

73
New cards
<p>Consider the code. Is the variable k on line 14 local or global?</p>

Consider the code. Is the variable k on line 14 local or global?

Global

74
New cards
<p>Consider the code. Is the variable k on line 9 local or global?</p>

Consider the code. Is the variable k on line 9 local or global?

Local since its initialized as int k=2

75
New cards
<p>What would be the output to the serial console of the entire program, after the loop runs exactly once?</p>

What would be the output to the serial console of the entire program, after the loop runs exactly once?

2

4

3

4

8

3

76
New cards
<p>Consider the following code snippet. What would be output to the screen?</p>

Consider the following code snippet. What would be output to the screen?

0

-2

77
New cards
<p>Consider the code snippet. What would be output to the screen?</p>

Consider the code snippet. What would be output to the screen?

-2

It would only finish the do-loop since the while loop wont run because count = -2 which is less than 0 so the while condition is false

78
New cards
<p>Consider the code snippet. What would be the output to the screen if the sensorValue is 475? What would the LED do?</p>

Consider the code snippet. What would be the output to the screen if the sensorValue is 475? What would the LED do?

The output would be 23.3 and the LED would blink. The LED lights, waits 500 ms, then turns off, waits 500 ms, and repeats.

79
New cards
<p>Consider the code snippet. What would be the output to the screen if the sensorValue is 614? What would the LED do?</p>

Consider the code snippet. What would be the output to the screen if the sensorValue is 614? What would the LED do?

The output would be 30.0 and the LED would turn on and stay lit

80
New cards
<p>Consider the code. <br><br>Suppose you run the code above but are noticing that the debounce isnt very effective because it is too short. How would you change the code?</p>

Consider the code.

Suppose you run the code above but are noticing that the debounce isnt very effective because it is too short. How would you change the code?

The debounce isnt as effective because it needs to be greater than 5 ms. To fix this, both lines 5 and 7 should be changed to say delay(100) . If its still too short, then both lines should be changed to delay(1000).

81
New cards

Write a code snippet (at most 5 lines that will):

1. Configure the PWM capable pin 11 as a output

  1. Read a value from analog input A1

  2. Linearly scale the pin A1 analog value to a value between 0-255 using the map() function

  3. Write to pin 11 using analogWrite

NOTE: analogRead values are 0-1023 and analogWrite values are 0-255

pinMode(11, OUTPUT); //Set pin 11 as output

int sensorValue = analogRead(A1); //Read a Value from A1

int scaledValue = map(sensorValue, 0, 1023, 0, 255); // Scaling

analoWrite(11, scaledValue); //Write scaled result to pin 11