Giter Club home page Giter Club logo

python-periphery-tm1637's Introduction

python-periphery-tm1637

CodeFactor

This module contains methods to drive the TM1637 display module as well as clock, scrolling ASCII text and system information functionality. Attaching this to a SBC can give useful insight on the system status or just keep time.

TM1637 8 segment, 4 digit LED examples:

Hardware requiments

TM1637 8 segment 0.36INCH Digital Display Tube 4 digit LED module:

Software requiments

python-periphery library.

sudo apt update
sudo apt install git python3-pip python3-setuptools
git clone https://github.com/vsergeev/python-periphery.git
cd python-periphery/
python3 -m pip install python-periphery

Why python-periphery

python-periphery is a highly compatible library.
Available for most Pi boards.

Wiring

LED Module Raspberry Pi
CLK Pin#5 (*1)
DIO Pin#3 (*1)
GND GND
5V 3V3 (*2)

(*1)
You can use any GPIO with startup arguments.

(*2)
RPi reads data from DIO, so it must be 3V3.

Setup

cd $HOME
git clone https://github.com/nopnop2002/python-periphery-tm1637
cd python-periphery-tm1637/
python3 tm1637.py

If you use this module on something other than Raspberry Pi, you will need to change the GPIO.

$ python3 tm1637.py --help
usage: tm1637.py [-h] [--clk CLK] [--dio DIO] [--text TEXT]

optional arguments:
  -h, --help   show this help message and exit
  --clk CLK    CLK GPIO
  --dio DIO    DIO GPIO
  --text TEXT

If you use Pin#3 and Pin#5, it will be as follows.

CLK(Pin#5) DIO(Pn#3)
Raspberry Pi 3 2 Default
Orange Pi Allwinner H2+ 11 12
Orange Pi Allwinner H3 11 12
Orange Pi Allwinner H5 11 12
Orange Pi Allwinner A64 226 227
Orange Pi 3 121 122
Orange Pi Lite2 229 230
Orange Pi OnePlus 229 230
Orange Pi RK3399 44 43
Orange Pi 4 65 64
Nano Pi Allwinner H3 11 12
Nano Pi Allwinner H5 11 12

Other default values are set as follows:

_DEF_TM1637_BRIGHT = 0xA       # Default brightness from 0x0 to 0xF
_DEF_TM1637_ANIM_DELAY = 0.2   # Default animation delay in seconds

If you want to display the CPU temperature, you need to change the following depending on the board.

show_on_high_cpu_thermal(tm, 50, "/sys/devices/virtual/thermal/thermal_zone0/temp")
# Please change your cpu sensor path if different

Start Auto Demo

python3 tm1637.py

When specifying GPIO.

python3 tm1637.py --clk=11 --dio=12

Privilege elevation might be required.

sudo -E python3 tm1637.py

Display text

python3 tm1637.py --text="any_text"

When specifying GPIO.

python3 tm1637.py --text="any_text" --clk=11 --dio=12

Privilege elevation might be required.

sudo -E python3 tm1637.py --text="any_text"

python-periphery-tm1637's People

Contributors

magnetrwn avatar nopnop2002 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

magnetrwn

python-periphery-tm1637's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.