Rotary dial
An old phone’s dial: each digit counted from its pulses, a number built up on the serial monitor.

The code
// A rotary dial, as an old phone has it. Click a digit on the dial while it runs.
// DIAL closes to GND while the dial is away from rest; PULSE, closed at rest, opens
// once for each count as it runs back (ten for 0). With the pull-ups on: DIAL reads
// LOW while dialing, and PULSE goes HIGH once for each count.
const int DIAL = 2;
const int PULSE = 3;
String number = "";
void setup() {
Serial.begin(9600);
pinMode(DIAL, INPUT_PULLUP);
pinMode(PULSE, INPUT_PULLUP);
Serial.println("Dial a number.");
}
void loop() {
if (digitalRead(DIAL) == HIGH) return;
int count = 0;
int last = digitalRead(PULSE);
while (digitalRead(DIAL) == LOW) {
int now = digitalRead(PULSE);
if (now == HIGH && last == LOW) count++;
last = now;
delay(5); // the contacts bounce less than this
}
int digit = count == 10 ? 0 : count;
number += String(digit);
Serial.print("Dialed ");
Serial.print(digit);
Serial.print(", the number so far: ");
Serial.println(number);
}
More like this

Keypad
A 4x4 keypad scanned with the Keypad library; each key on the serial port.
ArduinoArduino Uno

Rotary encoder
A KY-040 counted with an interrupt on CLK; press to reset.
ArduinoArduino Uno

RFID door (RC522)
The MFRC522 library reads a card’s UID: the known card lights green, any other red. Click the reader to hold a card to it.
ArduinoArduino Uno