Skip to content

nopnop2002/Raspberry-tm1637

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raspberry-tm1637

TM1637 Driver for RaspberryPi.
I based it on this.

tm1637-ip tm1637-play tm1637-stop

Changes from the original

  • Applied to WiringPi.
  • Added display of ascii characters.
  • Added text scroll display function.
  • Added text animation display function.

Software requirement

WiringPi Library
This project uses the wiringPiSetupGpio() function to initialize GPIO.
If you use it on a board other than the RPI board, you may need to change the GPIO number.
As far as I know, there are these libraries.

  • WiringPi for OrangePi
  • WiringPi for BananaPi
  • WiringPi for NanoPi
  • WiringPi for Pine-64

Hardware requirement

TM1637 8 segment 0.36INCH Digital Display Tube 4 digit LED module.
There are several products with different segments.

  • Product 1
    8 segments with dots + 8 segments with dots + 8 segments with dots + 8 segments with dots
  • Product 2
    7 segments + 8 segments with colon + 7 segments + 7 segments

TM1637-1 TM1637-2

Build

git clone https://github.com/nopnop2002/Raspberry-tm1637
cd Raspberry-tm1637
cc -o tm1637 main.c tm1637.c -lwiringPi -lpthread

Wiring

TM1637 RPi
CLK -- GPIO3 (*1)
DIO -- GPIO2 (*1)
GND -- GND
VCC -- 3.3V

(*1)
The TM1637's interface is similar to I2C, but it is not I2C.
Therefore, you can change it to any pin using arguments.

How to use

$ ./tm1637 --help
./tm1637: invalid option -- '-'
usage: tm1637  [-c CLK] [-d DIO] [-t TEXT]

optional arguments:
  -c CLK    CLK GPIO
  -d DIO    DIO GPIO
  -t TEXT   Display Text

Start Auto Demo using default GPIO

./tm1637

Start Auto Demo using non-default GPIO

Example of CLK=GPIO14/DIO=GPIO15.

./tm1637 -c 14 -d 15

Display any text using default GPIO

./tm1637 -t "12345 67890"

Display any text using non-default GPIO

Example of CLK=GPIO14/DIO=GPIO15.

./tm1637 -c 14 -d 15 -t "12345 67890"

About

TM1637 Driver for RaspberryPi.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages