Skip to content

Commit f82dfcc

Browse files
committed
Add mpremote mip
1 parent 62c9ae2 commit f82dfcc

File tree

3 files changed

+40
-17
lines changed

3 files changed

+40
-17
lines changed

README.md

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,30 @@
11
# MicroPython TM1640 LED Matrix
22

3-
A MicroPython library for a LED matrix using the TM1740 LED driver.
3+
A MicroPython library for a LED matrix modules using the TM1740 LED driver.
44

55
![demo](docs/demo.jpg)
66

7-
## Examples
7+
## Installation
88

9-
Copy the file to your device, using ampy, webrepl or compiling and deploying. eg.
9+
Using mip via mpremote:
1010

11+
```bash
12+
$ mpremote mip install github:mcauser/micropython-tm1640
1113
```
12-
$ ampy put tm1640.py
14+
15+
Using mip directly on a WiFi capable board:
16+
17+
```python
18+
>>> import mip
19+
>>> mip.install("github:mcauser/micropython-tm1640")
1320
```
1421

22+
Manual installation:
23+
24+
Copy `tm1640.py` to the root directory of your device.
25+
26+
## Examples
27+
1528
**Basic usage**
1629

1730
```python
@@ -49,29 +62,31 @@ tm.write_int(0x55aa55aa55aa55aa)
4962

5063
For more detailed examples, see ![tm1640_test.py](tm1640_test.py)
5164

52-
## Parts
65+
## Modules
5366

54-
* [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) $3.50 USD
55-
* [Clone DIY More WeMos Matrix LED Shield](https://www.aliexpress.com/item/Matrix-LED-Shield-V1-0-0-For-WEMOS-D1-Mini-Digital-Signal-Output-Module-8-X/32821752799.html) $1.35 USD
56-
* [Dual Base for WeMos D1 Mini](https://www.aliexpress.com/store/product/Dual-Base-for-WeMos-D1-mini/1331105_32642733925.html) $1.00 USD
67+
* [WeMos D1 Mini](https://www.aliexpress.com/item/32529101036.html)
68+
* [WeMos Matrix LED Shield](https://www.aliexpress.com/item/32812932291.html)
69+
* [DIY More MatrixLED Shield for D1 Mini](https://www.aliexpress.com/item/32821752799.html)
70+
* [Dual Base for WeMos D1 Mini](https://www.aliexpress.com/item/32642733925.html)
5771

5872
## Connections
5973

60-
WeMos D1 Mini | TM1640 LED Matrix
61-
------------- | -----------------
62-
D5 (GPIO14) | CLK
63-
D7 (GPIO13) | DIO
64-
3V3 (or 5V) | VCC
65-
G | GND
74+
`CLK` and `DIO` are bit-banged. You can use any GPIO.
75+
76+
TM1640 LED Matrix | WeMos D1 Mini
77+
----------------- | -------------
78+
CLK | D5 (GPIO14)
79+
DIO | D7 (GPIO13)
80+
VCC | 3V3/5V
81+
GND | G
6682

6783
## Links
6884

69-
* [WeMos D1 Mini](https://wiki.wemos.cc/products:d1:d1_mini)
85+
* [WeMos D1 Mini](https://www.wemos.cc/en/latest/d1/index.html)
7086
* [micropython.org](http://micropython.org)
7187
* [TM1640 datasheet](http://www.titanmic.com/pic/other/2014-11-20-15-36-028.pdf)
7288
* [Titan Micro TM1640 product page](http://www.titanmec.com/index.php/en/project/view/id/305.html)
7389
* [MicroPython framebuf](http://docs.micropython.org/en/latest/esp8266/library/framebuf.html)
74-
* [Adafruit Ampy](https://learn.adafruit.com/micropython-basics-load-files-and-run-code/install-ampy)
7590

7691
## License
7792

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"urls": [
3+
["tm1640.py", "github:mcauser/micropython-tm1640/tm1640.py"]
4+
],
5+
"version": "1.0.0"
6+
}

tm1640.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
https://github.com/mcauser/micropython-tm1640
44
55
MIT License
6-
Copyright (c) 2017 Mike Causer
6+
Copyright (c) 2017-2023 Mike Causer
77
88
Permission is hereby granted, free of charge, to any person obtaining a copy
99
of this software and associated documentation files (the "Software"), to deal
@@ -28,6 +28,8 @@
2828
from machine import Pin
2929
from time import sleep_us
3030

31+
__version__ = '1.0.0'
32+
3133
TM1640_CMD1 = const(64) # 0x40 data command
3234
TM1640_CMD2 = const(192) # 0xC0 address command
3335
TM1640_CMD3 = const(128) # 0x80 display control command

0 commit comments

Comments
 (0)