Setting pin mode (IN, OUT)
📖 Scenario: You have a Raspberry Pi and want to control an LED and read a button press. To do this, you need to set the pins to the right mode: input for the button and output for the LED.
🎯 Goal: Learn how to set the pin mode to IN or OUT using the Raspberry Pi GPIO library.
📋 What You'll Learn
Use the
RPi.GPIO librarySet pin 18 as output for an LED
Set pin 23 as input for a button
💡 Why This Matters
🌍 Real World
Setting pin modes is essential when connecting sensors, buttons, and LEDs to a Raspberry Pi for home automation or robotics projects.
💼 Career
Understanding GPIO pin modes is important for hardware interfacing roles, embedded systems programming, and IoT development.
Progress0 / 4 steps