0
0
Raspberry Piprogramming~5 mins

Setting pin mode (IN, OUT) in Raspberry Pi - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does setting a pin mode to IN mean on a Raspberry Pi?
Setting a pin mode to IN means the pin is configured to read signals, like detecting if a button is pressed.
Click to reveal answer
beginner
What does setting a pin mode to OUT mean on a Raspberry Pi?
Setting a pin mode to OUT means the pin is configured to send signals, like turning an LED on or off.
Click to reveal answer
beginner
Which Python library is commonly used to set pin modes on a Raspberry Pi?
The RPi.GPIO library is commonly used to set pin modes and control pins on a Raspberry Pi.
Click to reveal answer
beginner
How do you set pin 18 as an output pin using RPi.GPIO in Python?
You use GPIO.setup(18, GPIO.OUT) to set pin 18 as an output pin.
Click to reveal answer
beginner
Why is it important to set the pin mode before using a pin on Raspberry Pi?
Setting the pin mode tells the Raspberry Pi if the pin will send signals (output) or receive signals (input), preventing damage and ensuring correct behavior.
Click to reveal answer
What does GPIO.setup(pin, GPIO.IN) do?
ASets the pin as an input to read signals
BSets the pin as an output to send signals
CTurns the pin off
DResets the pin mode
Which pin mode would you use to turn on an LED?
AOUT
BANALOG
CINPUT_PULLUP
DIN
What Python library is commonly used for GPIO pin control on Raspberry Pi?
APandas
BNumPy
CMatplotlib
DRPi.GPIO
What happens if you try to read a pin set as OUT?
AYou get an error
BYou read the input signal
CYou get the output value you set
DThe pin resets automatically
Why should you set pin modes before using pins?
ATo speed up the program
BTo avoid damaging the Raspberry Pi and ensure correct signal flow
CTo save memory
DTo change the pin number
Explain what setting a pin mode to IN or OUT means on a Raspberry Pi and why it matters.
Think about whether the pin is reading or sending signals.
You got /4 concepts.
    Describe how you would set up a pin as an output in Python using RPi.GPIO and what you could do with it.
    Focus on the code and the purpose of output mode.
    You got /4 concepts.