0
0
Embedded Cprogramming~5 mins

Writing HIGH and LOW to output pins in Embedded C - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does writing HIGH to an output pin mean in embedded C?
Writing HIGH sets the output pin voltage to a high level, usually 5V or 3.3V, turning the pin ON or activating connected devices like LEDs.
Click to reveal answer
beginner
How do you write LOW to an output pin in embedded C?
You write LOW by setting the pin's output register to 0, which sets the pin voltage to 0V, turning the pin OFF or deactivating connected devices.
Click to reveal answer
beginner
Which function is commonly used to set a pin HIGH or LOW in Arduino (embedded C)?
The function digitalWrite(pin, value) is used, where value can be HIGH or LOW to set the pin voltage accordingly.
Click to reveal answer
beginner
Why must a pin be set as OUTPUT before writing HIGH or LOW?
Pins default to input mode. Setting a pin as OUTPUT configures it to send voltage signals, allowing you to write HIGH or LOW to control devices.
Click to reveal answer
intermediate
What happens if you write HIGH to a pin configured as INPUT?
Writing HIGH to an INPUT pin usually enables the internal pull-up resistor, but does not drive the pin voltage high externally; the pin reads signals instead of sending them.
Click to reveal answer
What voltage level does writing HIGH to an output pin usually set?
A12V
B0V
CIt depends on the input signal
D5V or 3.3V
Which function sets a pin as output in Arduino embedded C?
AdigitalWrite(pin, OUTPUT)
BpinMode(pin, OUTPUT)
CsetPin(pin, OUTPUT)
DwritePin(pin, OUTPUT)
What does digitalWrite(pin, LOW) do?
ASets the pin voltage to 0V
BSets the pin voltage to 5V
CReads the pin voltage
DConfigures the pin as input
If a pin is not set as OUTPUT, what happens when you write HIGH to it?
ANo voltage is driven on the pin
BPin voltage goes to 5V
CPin voltage goes to 0V
DPin mode changes to OUTPUT automatically
Which of these is the correct way to turn on an LED connected to pin 13?
ApinMode(13, INPUT); digitalWrite(13, HIGH);
BdigitalWrite(13, HIGH); pinMode(13, OUTPUT);
CpinMode(13, OUTPUT); digitalWrite(13, HIGH);
DdigitalWrite(13, LOW); pinMode(13, OUTPUT);
Explain how to turn an output pin HIGH and LOW in embedded C and why setting pin mode matters.
Think about configuring the pin first, then sending voltage signals.
You got /4 concepts.
    Describe what happens if you try to write HIGH to a pin that is set as INPUT.
    Consider the difference between input and output pin modes.
    You got /4 concepts.