{"id":13613304,"url":"https://github.com/mcauser/micropython-tm1640","last_synced_at":"2025-10-25T03:30:48.609Z","repository":{"id":57441517,"uuid":"113177985","full_name":"mcauser/micropython-tm1640","owner":"mcauser","description":"MicroPython driver for TM1740 8x8 LED matrix modules","archived":false,"fork":false,"pushed_at":"2023-07-01T06:48:51.000Z","size":1013,"stargazers_count":15,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-31T05:32:57.803Z","etag":null,"topics":["esp8266","led-matrix","micropython","tm1640","wemos-d1-mini"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mcauser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-12-05T12:14:49.000Z","updated_at":"2024-11-21T18:47:41.000Z","dependencies_parsed_at":"2024-01-29T19:46:49.355Z","dependency_job_id":null,"html_url":"https://github.com/mcauser/micropython-tm1640","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"62c9ae24a4264b0d600834965576636a20d966a5"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcauser%2Fmicropython-tm1640","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcauser%2Fmicropython-tm1640/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcauser%2Fmicropython-tm1640/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcauser%2Fmicropython-tm1640/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcauser","download_url":"https://codeload.github.com/mcauser/micropython-tm1640/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238071156,"owners_count":19411600,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esp8266","led-matrix","micropython","tm1640","wemos-d1-mini"],"created_at":"2024-08-01T20:00:43.770Z","updated_at":"2025-10-25T03:30:47.937Z","avatar_url":"https://github.com/mcauser.png","language":"Python","readme":"# MicroPython TM1640 LED Matrix\n\nA MicroPython library for a LED matrix modules using the TM1740 LED driver.\n\n![demo](docs/demo.jpg)\n\n## Installation\n\nUsing mip via mpremote:\n\n```bash\n$ mpremote mip install github:mcauser/micropython-tm1640\n```\n\nUsing mip directly on a WiFi capable board:\n\n```python\n\u003e\u003e\u003e import mip\n\u003e\u003e\u003e mip.install(\"github:mcauser/micropython-tm1640\")\n```\n\nManual installation:\n\nCopy `tm1640.py` to the root directory of your device.\n\n## Examples\n\n**Basic usage**\n\n```python\nimport tm1640\nfrom machine import Pin\ntm = tm1640.TM1640(clk=Pin(14), dio=Pin(13))\n\n# line from bottom left to top right\ntm.write([1, 2, 4, 8, 16, 32, 64, 128])\n\n# all on\ntm.write([255, 255, 255, 255, 255, 255, 255, 255])\n\n# all off\ntm.write([0, 0, 0, 0, 0, 0, 0, 0])\n\n# all LEDs dim\ntm.brightness(1)\n\n# all LEDs bright\ntm.brightness(7)\n\n# the number 3\ntm.write([0b00000000, 0b00011110, 0b00110011, 0b00110000, 0b00011100, 0b00110000, 0b00110011, 0b00011110])\n\n# cross\ntm.write(b'\\x81\\x42\\x24\\x18\\x18\\x24\\x42\\x81')\n\n# squares\ntm.write([255, 129, 189, 165, 165, 189, 129, 255])\n\n# 50% on\ntm.write_int(0x55aa55aa55aa55aa)\n```\n\nFor more detailed examples, see ![tm1640_test.py](tm1640_test.py)\n\n## Modules\n\n* [WeMos D1 Mini](https://www.aliexpress.com/item/32529101036.html)\n* [WeMos Matrix LED Shield](https://www.aliexpress.com/item/32812932291.html)\n* [DIY More MatrixLED Shield for D1 Mini](https://www.aliexpress.com/item/32821752799.html)\n* [Dual Base for WeMos D1 Mini](https://www.aliexpress.com/item/32642733925.html)\n\n## Connections\n\n`CLK` and `DIO` are bit-banged. You can use any GPIO.\n\nTM1640 LED Matrix | WeMos D1 Mini\n----------------- | -------------\nCLK               | D5 (GPIO14)\nDIO               | D7 (GPIO13)\nVCC               | 3V3/5V\nGND               | G\n\n## Links\n\n* [WeMos D1 Mini](https://www.wemos.cc/en/latest/d1/index.html)\n* [micropython.org](http://micropython.org)\n* [TM1640 datasheet](http://www.titanmic.com/pic/other/2014-11-20-15-36-028.pdf)\n* [Titan Micro TM1640 product page](http://www.titanmec.com/index.php/en/project/view/id/305.html)\n* [MicroPython framebuf](http://docs.micropython.org/en/latest/esp8266/library/framebuf.html)\n\n## License\n\nLicensed under the [MIT License](http://opensource.org/licenses/MIT).\n","funding_links":[],"categories":["精选驱动库","Libraries"],"sub_categories":["显示类","Display"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcauser%2Fmicropython-tm1640","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcauser%2Fmicropython-tm1640","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcauser%2Fmicropython-tm1640/lists"}