{
  "id": "mcauser/micropython-tm1640",
  "name": "micropython-tm1640",
  "prettyName": "micropython-tm1640",
  "description": "MicroPython driver for TM1740 8x8 LED matrix modules",
  "version": "",
  "author": "mcauser",
  "license": "MIT",
  "tags": [
    "esp8266",
    "led-matrix",
    "micropython",
    "tm1640",
    "wemos-d1-mini"
  ],
  "status": "VALID",
  "official": false,
  "source": "https://github.com/mcauser/micropython-tm1640",
  "updatedAt": "2026-06-30T07:00:32.381Z",
  "page": "https://checkmim.com/packages/mcauser+micropython-tm1640",
  "createdAt": "2025-05-27T04:29:11.969Z",
  "submittedBy": "oliverr",
  "install": {
    "mpremote": "mpremote mip install github:mcauser/micropython-tm1640",
    "mip": "import mip; mip.install(\"github:mcauser/micropython-tm1640\")"
  },
  "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>>> import mip\n>>> 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"
}