TM1637 Driver for RaspberryPi.
I based it on this.
- Applied to WiringPi.
- Added display of ascii characters.
- Added text scroll display function.
- Added text animation display function.
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
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
git clone https://github.com/nopnop2002/Raspberry-tm1637
cd Raspberry-tm1637
cc -o tm1637 main.c tm1637.c -lwiringPi -lpthread
| 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.
$ ./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
./tm1637
Example of CLK=GPIO14/DIO=GPIO15.
./tm1637 -c 14 -d 15
./tm1637 -t "12345 67890"
Example of CLK=GPIO14/DIO=GPIO15.
./tm1637 -c 14 -d 15 -t "12345 67890"
