Skip to main content

MicroPython Simple Keypad

MicroPython License

MicroPython library for interfacing with a keypad matrix

Feature

  • Supports any keypad matrix configuration.

  • Easily customizable for different keypad layouts.

  • Provides exception handling for error management.

Example Usage

Example for 4x4 keypad metrix on MicroPython esp32.

from machine import Pin
from keypad import Keypad
from time import sleep

# Define GPIO pins for rows
row_pins = [Pin(25),Pin(26),Pin(27),Pin(14)]

# Define GPIO pins for columns
column_pins = [Pin(23),Pin(22),Pin(19),Pin(18)]

# Define keypad layout
keys = [
    ['1', '2', '3', 'A'],
    ['4', '5', '6', 'B'],
    ['7', '8', '9', 'C'],
    ['*', '0', '#', 'D']]

keypad = Keypad(row_pins, column_pins, keys)

while True:
    key_pressed = keypad.read_keypad()
    if key_pressed:
        print("Key pressed:", key_pressed)
    sleep(0.1)  # debounce and delay

Metadata

Release files for micropython-simple-keypad 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for micropython-simple-keypad 1.0.3
File Size Uploaded
micropython-simple-keypad-1.0.3.tar.gz 3.5 kB Details

Release files / micropython-simple-keypad-1.0.3.tar.gz

Download URL micropython-simple-keypad-1.0.3.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
96007d51efa91b3c7c838953326ddfd4dad9a53cf77ec6acd09f38c3ea776ac6
BLAKE2b-256 checksum
How to use checksums
0e498e665e0c89488e72bd6e0826b2d05ff64ed00cf8db84a3dd925afd20c55e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.10

Release history Release notifications | RSS feed

This release

1.0.3 This release

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page