Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Raspberry Pi 4B Controlled LED with 4×4 Keypad Input

View and Edit Project In Cirkit DesignerImage of Raspberry Pi 4B Controlled LED with 4×4 Keypad Input

Circuit Documentation

Summary

This circuit involves a Raspberry Pi 4B, a red LED, a 220 Ohm resistor, and a 4×4 Keypad. The Raspberry Pi controls the LED and reads input from the keypad. The LED is connected to the Raspberry Pi through a resistor to limit the current. The keypad is used to provide input to the Raspberry Pi.

Component List

Raspberry Pi 4B

LED: Two Pin (red)

Resistor

4×4 Keypad

Wiring Details

Raspberry Pi 4B

LED: Two Pin (red)

Resistor

4×4 Keypad

Code Documentation

Raspberry Pi 4B Code

from gpiozero import LED
from gpiozero import Button

led = LED(4)
button = Button(17)

while True:
    button.wait_for_press()
    led.on()
    button.wait_for_release()
    led.off()

4×4 Keypad Code

void setup() {
  // put your setup code here, to run once:
}

void loop() {
  // put your main code here, to run repeatedly:
}