A little curiosity. A whole lot of making.Robotics, CNC & connected ideas
robodatech.
Arduino sample library

Digital Input Pullup 10

Read buttons, limit switches, and contact sensors with stable internal pullups.

Open in compiler →

Source code and build tools are available in the protected platform workspace.

How it works

Read a button or limit switch reliably using the internal pullup resistor.

  1. Wire one side of the switch to the input pin and the other side to GND.
  2. Enable INPUT_PULLUP so no external resistor is required.
  3. Treat LOW as pressed and HIGH as released.
  4. Mirror the state to D13 and Serial Monitor.

Connections

PinConnect toNote
D11Push button or limit switch to GNDPressed reads LOW because the internal pullup is enabled.
D13Built-in LED or indicator LED through resistorD13 is safe for the onboard LED on most Arduino boards.

Good ideas start here.

Free robotics lessons, CNC build notes and product updates. Confirm your email to join. Unsubscribe anytime.