Digital Input (GPIO) Initialization (gpio_init_get)¶
What it does: Sets the selected pin to digital input mode including internal pull-up/pull-down selection.

Inputs¶
pin: pin number (usually via blockpinout).- Field
in_pin: input/pull mode according to block menu.
Output¶
- none (command block).
When to use it¶
- At the beginning of the program before rereading the pin.
- When you need a stable input without external resistors.
Tips and pitfalls¶
- Do the initialization once, not in every iteration of the loop.
- Pull mode must match the physical connection of the button/sensor.
Generated Python example¶
from machine import Pin
Pin22 = Pin(22, Pin.IN, Pin.PULL_UP)