forked from mcauser/micropython-tm1637
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from depklyon/port-to-python
Port to python 3
- Loading branch information
Showing
4 changed files
with
85 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from tm1637 import TM1637 | ||
from time import time, sleep, localtime | ||
|
||
DIO=0 | ||
CLK=1 | ||
|
||
def show_clock(tm): | ||
t = localtime() | ||
sleep(1 - time() % 1) | ||
|
||
tm.numbers(t.tm_hour, t.tm_min, True) | ||
sleep(.5) | ||
tm.numbers(t.tm_hour, t.tm_min, False) | ||
|
||
if __name__ == "__main__": | ||
print("\n") | ||
print("============================") | ||
print(" Starting clock application") | ||
print("============================") | ||
|
||
tm = TM1637(CLK, DIO) | ||
tm.brightness(1) | ||
|
||
while True: | ||
show_clock(tm) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,21 +5,21 @@ | |
from setuptools import setup | ||
|
||
setup( | ||
name='micropython-tm1637', | ||
name='raspberrypi-python-tm1637', | ||
py_modules=['tm1637'], | ||
version='1.1.0', | ||
description='MicroPython library for TM1637 LED driver.', | ||
long_description='This library lets you operate quad 7-segment LED display modules based on the TM1637 LED driver.', | ||
keywords='tm1637 seven segment led micropython', | ||
url='https://github.com/mcauser/micropython-tm1637', | ||
version='1.0.0', | ||
description='Raspberry Pi Python port from MicroPython library for TM1637 LED driver.', | ||
long_description='This library lets you operate quad 7-segment LED display modules based on the TM1637 LED driver with Raspberry PI.', | ||
keywords='tm1637 raspberry pi seven segment led python', | ||
url='https://github.com/depklyon/raspberrypi-python-tm1637', | ||
author='Mike Causer', | ||
author_email='[email protected]', | ||
maintainer='Mike Causer', | ||
maintainer_email='mcauser@gmail.com', | ||
maintainer='Patrick Palma', | ||
maintainer_email='patrick.depalma@gmail.com', | ||
license='MIT', | ||
classifiers = [ | ||
'Development Status :: 5 - Production/Stable', | ||
'Programming Language :: Python :: Implementation :: MicroPython', | ||
'Programming Language :: Python :: Implementation :: Python', | ||
'License :: OSI Approved :: MIT License', | ||
], | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters