Gokino
Learn Arduino with AI
#044 分钟Lesson4_PushbuttonPullUp.ino

Arduino按钮与INPUT_PULLUP (1行解决浮空引脚乱闪!) | 第 #4 课

1行代码彻底解决Arduino按钮乱闪!零基础搞懂浮空引脚原理、内置INPUT_PULLUP对比10kΩ外置电阻与Active-LOW反向逻辑。

核心要点

  • 在Chrome免安装打开Gokino.dev
  • 本课6样电子配件清单
  • 浮空引脚原理与内置INPUT_PULLUP
  • 用Gokino AI /wiring查看交互式电路图

实验台硬件清单

  • Arduino Uno R3: ATmega328P 5V brain board with built-in 20k-50kΩ pull-up resistors + USB-B data cable
  • Solderless Breadboard: Half-size 400-point grid: 5-hole rows A-E / F-J, center gap, and blue (-) GND rail
  • 4-Pin Tactile Pushbutton: 6x6mm momentary switch straddling center gap (no polarity; uses built-in INPUT_PULLUP)
  • 5mm Red External LED: One-way 2.0V bulb (15mA safe): long (+) leg Anode, short flat-edge (-) leg Cathode
  • 220Ω Resistor: 1/4W Red-Red-Brown-Gold bands (either way works): protects LED at safe 13.6mA
  • Male-to-Male Jumper Wires: Blue Pin 2 wire, orange Pin 12 wire, and 3 black GND wires (no 5V wire needed!)

10 秒硬件小挑战

Your pushbutton circuit works cleanly! Try flipping LOW to HIGH on gokino.dev for a fridge-door light, and subscribe for Lesson Five!