Lecture 7 - TTGO Flashcards

1
Q

How do you set TTGO to read/take an input (external)?

A

pinMode(26, INPUT) -> this will connect to pin 26 on the TTGO and set it to an input pin. This is an exeternal pull up resistor (ie when an external resistor is added
x = digitalRead(26) -> will read the data from pin 26

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

How do you set TTGO to read/take an input (internal)?

A

pinMode(26, INPUT_PULLUP) -> this will connect to pin 26 on the TTGO and set it to an input pin. This is an internal pull up resistor (ie when the internal resistor in the TTGO is used)
x = digitalRead(26) -> will read the data from pin 26

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

How do you set TTGO to write/output?

A

pinMode(27, OUTPUT) -> this will connect to pin 27 on the TTGO and set it to an output pin.
digitalWrite(27, HIGH) -> can put LOW or HIGH but HIGH means on and LOW means off

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

What code do you use for displaying things on an LCD?

A

The library you use is TFT_eSPI.h (header file as we code in c)
the call if tft. this can be followd by:
1. init() to initialise
2. setTextSize(value) to set size of text
3. drawString(“text”, 0, 0) ro draw text at column o and row 0
4. setTextColor(TFT_BLACK) to set text to black
5. fillScreen(TFT_BLACK) to set background to black

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

When does a switch bounce occur?

A

When pushing a button

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