Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TM1637. tm.scroll on 6 digit display does not work correctly. #11

Open
wants to merge 55 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
88fa14f
Doc updates
depklyon Jul 27, 2017
005200d
Port to python 3
depklyon Jul 27, 2017
97446a9
Merge pull request #1 from depklyon/newdoc
depklyon Jul 27, 2017
6d6f307
Merge pull request #2 from depklyon/port-to-python
depklyon Jul 27, 2017
abf7087
Clock example: Remove unnecessary module checking
Aug 19, 2017
a21eec2
Add missing temperature method
Aug 19, 2017
fbbecd2
Add asterisk (to represent º) for temp display
depklyon Aug 19, 2017
140b00e
Add animated image
depklyon Aug 19, 2017
0fbe006
Update README.md
depklyon Aug 19, 2017
b187df3
Fix indentation
Aug 19, 2017
58c67e9
Optimize gif size
Aug 19, 2017
42a5138
Updating the python3 version of the tm1637 library with the latest fr…
lawerencem Oct 30, 2018
a3cb117
removing the use of sleep_us and sleep_ms
lawerencem Oct 30, 2018
fff4feb
Removing some duplicate constants that were created during a merge.
lawerencem Oct 30, 2018
ef8e234
Correcting a classifier in setup.py
lawerencem Nov 1, 2018
e61cf7c
Merge pull request #3 from lawerencem/master
depklyon Nov 19, 2018
36cfa6b
Update package metadata
depklyon Nov 19, 2018
54ae23a
Add port repository to header
depklyon Nov 19, 2018
4f9e43a
Merge pull request #4 from depklyon/docupdates
depklyon Nov 19, 2018
2b2995f
Remove useless machine dependency, adjust formatting
coliss86 Jan 5, 2019
862874e
sleep_ms() doesn't exists, switching to sleep()
coliss86 Jan 5, 2019
d16757c
Remove useless machine dependency
coliss86 Jan 5, 2019
f257a7f
Add gitignore
coliss86 Jan 5, 2019
71a577d
Use digitalWrite() and digitalWrite() when writing/reading to the bus
coliss86 Jan 5, 2019
9e82f2d
Update gif animation showing most of the example available
coliss86 Jan 5, 2019
95f33d8
Merge pull request #5 from coliss86/fix_doc
depklyon Jun 26, 2019
3b408ee
Merge pull request #6 from coliss86/fix_example
depklyon Jun 26, 2019
5787cfb
Merge pull request #7 from coliss86/gitignore
depklyon Jun 26, 2019
5344542
Merge pull request #9 from coliss86/gif
depklyon Jun 26, 2019
48360bb
Add more relevant info for Raspberry Pi
depklyon Jun 26, 2019
a3ac5b0
Add installation instructions to README.md
mdhs-science Jul 3, 2020
3b5ca81
Merge pull request #8 from coliss86/fix_api
depklyon Jul 8, 2020
e3cf562
Reformatted files following PEP8
depklyon Jul 15, 2020
c3502ca
Renamed tm1637_test to demo and added small improvements
depklyon Jul 15, 2020
b5298ef
Added unittest test file
depklyon Jul 15, 2020
3ce86ad
Move clock.py to examples and improve code
depklyon Jul 15, 2020
d1e6724
Set version 1.3.1
depklyon Jul 15, 2020
3f09444
Improvements and repository rename for pypi package
depklyon Jul 22, 2020
1da8a72
Update link for demo
depklyon Jul 22, 2020
21d2896
Update README.md
depklyon Jul 24, 2020
cd25e15
Merge pull request #10 from MrSiliconGuy/master
depklyon Jul 24, 2020
9700c5b
Create python-publish.yml
depklyon Jul 24, 2020
f079805
Added support for decimal temperature values
giddyhup Apr 28, 2021
cd1c349
Followed suggestions, addressed potential issue
giddyhup May 6, 2021
988eebe
improve "if" block
depklyon May 6, 2021
b9305fc
Merge pull request #11 from giddyhup/giddyhup-add-decimal-temp
depklyon May 6, 2021
1c0457b
Create codeql-analysis.yml
depklyon May 6, 2021
d105e23
Merge pull request #12 from depklyon/Add-codeQL-analysis
depklyon May 6, 2021
0f53866
remove endless loop from _write_byte and using the same implementatio…
chrisdecker1201 Sep 8, 2021
ec18b5a
Merge pull request #13 from chrisdecker1201/bug/endless_loop_leads_to…
depklyon Mar 15, 2022
5d18fc5
Update package version
depklyon Mar 15, 2022
3e2e4ea
Changed GPIO library from WiringPi to RPi.GPIO
0xEE77 Nov 24, 2022
60e4cb9
Merge pull request #14 from 0xEE77/RPiGPIO
depklyon Dec 2, 2022
04bf8f7
Update requirements and version
depklyon Dec 2, 2022
fcf71ce
Merge pull request #15 from depklyon/setup-updates
depklyon Dec 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '18 4 * * 2'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
31 changes: 31 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*.swp
__pycache__
/.idea/
/venv/
/build/
/dist/
/raspberrypi_tm1637.egg-info/
36 changes: 16 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
# MicroPython TM1637
# TM1637
# Raspberry Pi Python 3 TM1637

A MicroPython library for quad 7-segment LED display modules using the TM1637 LED driver.
A Python 3 port from MicroPython library for the quad 7-segment LED display modules based on the TM1637 LED driver, implemented on Raspberry Pi.

For example, the [Grove - 4 Digit Display module](http://wiki.seeed.cc/Grove-4-Digit_Display/)

![demo](docs/demo.jpg)
![demo](https://github.com/depklyon/raspberrypi-tm1637/raw/master/docs/raspberry_tm1637.gif)

## Examples
## Installation

Copy the file to your device, using ampy, webrepl or compiling and deploying. eg.
This project is available through [pip](https://www.w3schools.com/python/python_pip.asp). Make sure that you are using Python 3.

```
$ ampy put tm1637.py
$ pip3 install raspberrypi-tm1637
```

## Examples

**Basic usage**

```python
import tm1637
from machine import Pin
tm = tm1637.TM1637(clk=Pin(5), dio=Pin(4))
tm = tm1637.TM1637(clk=5, dio=4)

# all LEDS on "88:88"
tm.write([127, 255, 127, 127])
Expand Down Expand Up @@ -50,7 +52,7 @@ tm.number(-123)
tm.temperature(24)
```

For more detailed examples, see [tm1637_test.py](tm1637_test.py)
For more detailed examples, see [demo.py](https://github.com/depklyon/raspberrypi-tm1637/blob/master/demo.py)

# Seven Segment Font

Expand Down Expand Up @@ -160,7 +162,7 @@ temperature(num)
```

Show a string on the display.
Shorthand for write(encode_string()).
Shorthand for `write(encode_string())`.
Limited to first 4 characters.
```python
show(string, colon=False)
Expand All @@ -174,29 +176,23 @@ scroll(string, delay=250)

## Parts

* [WeMos D1 Mini](https://www.aliexpress.com/store/product/D1-mini-Mini-NodeMcu-4M-bytes-Lua-WIFI-Internet-of-Things-development-board-based-ESP8266/1331105_32529101036.html) $4.00 USD
* [Grove 4 Digit Display](https://www.seeedstudio.com/grove-4digital-display-p-1198.html) $5.90 USD
* [Grove Male Jumper Cable](https://www.seeedstudio.com/Grove-4-pin-Male-Jumper-to-Grove-4-pin-Conversion-Cable-%285-PCs-per-Pack%29-p-1565.html) $2.90 USD

## Connections

WeMos D1 Mini | 4 Digit Display
Raspberry Pi | 4 Digit Display
------------- | ---------------
D1 (GPIO5) | CLK
D2 (GPIO4) | DIO
GPIO5 | CLK
GPIO4 | DIO
3V3 (or 5V) | VCC
G | GND
GND | GND

## Links

* [WeMos D1 Mini](https://wiki.wemos.cc/products:d1:d1_mini)
* [micropython.org](http://micropython.org)
* [TM1637 datasheet](http://www.titanmec.com/index.php/en/project/download/id/302.html)
* [Titan Micro TM1637 product page](http://www.titanmec.com/index.php/en/project/view/id/302.html)
* [Nokia 5110 version](https://github.com/mcauser/MicroPython-ESP8266-Nokia-5110-Quad-7-segment)
* [BBC micro:bit version](https://github.com/mcauser/microbit-tm1637)
* [Adafruit Ampy](https://learn.adafruit.com/micropython-basics-load-files-and-run-code/install-ampy)
* [micropython-tm1637 on pypi](https://pypi.python.org/pypi/micropython-tm1637/)

## License

Expand Down
Loading