ESP - Week 3 Flashcards

1
Q

What do #define UP 1 and #define DOWN 2 do

A

Everything UP or DOWN is replaced by 1 or 2 respectively

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Macro pre-processor Syntax

A
#define (original) (replace)
no semi colon
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Define a two argument macro

A

define twoargmacro(a,b)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Declaring functions

A

output function_name(input){}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Button masks

A
#define BUTTON_UP 0x08
#define BUTTON_DOWN 0x04
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Fixing button up and button down

A

both_pressed = (x & BUTTON_UP) && (x & BUTTON_DOWN)

OR

both_pressed = x & (BUTTON_UP | BUTTON_DOWN)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Difference between & and &&

A
& = Bitwise And
&& = Logical And
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is Bitwise OR

A

|

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is Polling

A

When we continually check if something has changed

  • busy wait
  • low level
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is an event

A

When we wait for something to happen until one of them does

- high level

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Arduino Buttons

A

lcd.readButtons() - returns the current state of buttons

How well did you know this?
1
Not at all
2
3
4
5
Perfectly