Skip to main content

TM1637 4-digit display driver for Raspberry Pi 5 using gpiod

Project description

TM1637 Display Library for Raspberry Pi 5 (gpiod-based)

This is a modified version of the raspberrypi-tm1637 library, adapted to work on Raspberry Pi 5 using the gpiod backend.

🚀 Why this version?

The Raspberry Pi 5 uses a new GPIO controller that is not compatible with RPi.GPIO, which the original TM1637 library depends on.

This version replaces RPi.GPIO with gpiod (libgpiod), the officially supported GPIO access method in Raspberry Pi OS (Bookworm and newer).

Now, version 2.0.0 of tm1637-rpi5-gpiod, auto-detects whether libgpiod v1 or v2 is present and uses the appropriate backend:

  • libgpiod v1 (legacy API): per-line requests
  • libgpiod v2 (new API): LineSettings + request_lines() + LineRequest.set_value()

📥 Installation

  1. Install required dependencies:

    sudo apt update
    sudo apt install python3-libgpiod gpiod
    
  2. Install the library via pip:

    pip install tm1637-rpi5-gpiod
    

    Or clone manually:

    git clone https://github.com/villeparamio/tm1637-rpi5-gpiod.git
    cd tm1637-rpi5-gpiod
    pip install .
    

🧪 Example usage

import tm1637
from time import sleep

CLK = 24  # GPIO24 (physical pin 18)
DIO = 23  # GPIO23 (physical pin 16)

display = tm1637.TM1637(clk=CLK, dio=DIO)
display.brightness(7)

while True:
    display.show("TEST")
    sleep(2)
    display.numbers(12, 34)
    sleep(2)

Make sure your user is in the gpio group to access /dev/gpiochip* without root.
If needed: sudo usermod -aG gpio $USER && sudo reboot

🛠 Features

  • ✅ Raspberry Pi 5 compatible
  • ✅ Uses gpiod, not RPi.GPIO
  • ✅ Works with standard 4-digit TM1637 LED displays
  • ✅ Supports numbers, text, brightness and temperature

🔄 Original sources

📜 License

This project is licensed under the MIT License.

💖 Donations

If you find this project useful and want to support its development and maintenance, please consider making a donation.
Your contribution helps us continue improving and maintaining this free software.

💸 PayPal

You can easily donate via PayPal by clicking the button below:

Donate

Thank you for your support. 🙏

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tm1637_rpi5_gpiod-2.0.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tm1637_rpi5_gpiod-2.0.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file tm1637_rpi5_gpiod-2.0.0.tar.gz.

File metadata

  • Download URL: tm1637_rpi5_gpiod-2.0.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for tm1637_rpi5_gpiod-2.0.0.tar.gz
Algorithm Hash digest
SHA256 767f5bd7d5d9242a4fd3375a582e57fadfa5a6ca3b5ab2864e51b62a75fcbdc1
MD5 9f96b38c716a81bee610d54ed142bd3f
BLAKE2b-256 49f4aa8f1f30607a698e6387bdfbe750091018e2cc94d4af25de2ee7fd270f57

See more details on using hashes here.

File details

Details for the file tm1637_rpi5_gpiod-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tm1637_rpi5_gpiod-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4a2b8af2a2a53c03801ae47ca3a59afeaf502659d0ae95d23ea228bf4ccb2cfa
MD5 6feb0a245159bea86311f4a9104c8e96
BLAKE2b-256 e6f034b71aef0141f9e91a4459f66d3b8643ba1e6eb232486a3e1765e63da244

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page