{
  "id": "howmanyoliversarethere/micropython-st7735",
  "name": "micropython-st7735",
  "prettyName": "micropython-st7735",
  "description": "MicroPython driver for ST7735/ST7735S/ST7735R TFT displays",
  "version": "",
  "author": "howmanyoliversarethere",
  "license": "MIT",
  "tags": [],
  "status": "VALID",
  "official": false,
  "source": "https://github.com/howmanyoliversarethere/micropython-st7735",
  "updatedAt": "2026-10-28T08:35:23.957Z",
  "page": "https://checkmim.com/packages/howmanyoliversarethere+micropython-st7735",
  "createdAt": "2026-10-28T08:35:21.965Z",
  "submittedBy": "oliverr",
  "install": {
    "mpremote": "mpremote mip install github:howmanyoliversarethere/micropython-st7735",
    "mip": "import mip; mip.install(\"github:howmanyoliversarethere/micropython-st7735\")"
  },
  "readme": "# ST7735 TFT display\n\nA MicroPython driver for **Sitronix ST7735 / ST7735S / ST7735R** colour\nTFT controllers (such as common 1.8\" 128×160 panels) over SPI. It draws\ninto a full-screen RGB565 `framebuf.FrameBuffer`, so every framebuf\ndrawing method works, then sends it with `show()`.\n\nCopy `st7735.py` onto your board, or install it with `mip`:\n\n```python\nimport mip\nmip.install(\"github:HowManyOliversAreThere/micropython-st7735\")\n```\n\n## Usage\n\n```python\nfrom machine import SPI, Pin\nimport st7735\n\nspi = SPI(1, baudrate=26_000_000, sck=Pin(23), mosi=Pin(22))\ndisplay = st7735.ST7735(spi, cs=Pin(1), dc=Pin(8), rst=Pin(14), rotation=0)\n\nfb = display.fb\nfb.fill(st7735.color565(0, 0, 40))\nfb.rect(4, 4, display.width - 8, display.height - 8, st7735.color565(255, 255, 255))\nfb.text(\"Hello!\", 12, 12, st7735.color565(255, 200, 0))\ndisplay.show()\n\ndisplay.rotation(90)    # landscape: width/height swap, redraw everything\ndisplay.sleep()         # and switch the backlight off separately\n```\n\n### Is a display connected?\n\n`detect()` bit-bangs the panel's Read Display ID command on the SPI pins,\nlistening on SDA (and MISO, if given) with a pull-up. It returns the\nthree ID bytes, or `None` if nothing answers. Call it before setting up\nthe SPI bus, or re-initialise the bus afterwards:\n\n```python\nident = st7735.detect(sck=Pin(23), sda=Pin(22), cs=Pin(1), dc=Pin(8), miso=Pin(21), rst=Pin(14))\n```\n\nThis only works on panels that let the controller drive SDA (or bring\nSDO out). On a module where SDA is input-only, it reports `None` even\nwhen a panel is connected.\n\n## Notes\n\n- Colours from `color565()` are byte-swapped for the panel, so use them\n  (not plain RGB565 values) when drawing.\n- Panels vary. If colours are red/blue swapped, flip `bgr`. If there's a\n  stripe of noise at an edge, set `x_offset`/`y_offset` (often 2 and 1).\n  If colours are inverted, set `invert=True`.\n- The buffer takes `width × height × 2` bytes (40 KB at 128×160). Pass\n  your own `buffer` to share or preallocate it.\n- `show_rows(y0, y1)` sends only part of the screen, which is quicker for\n  small updates.\n\n## License\n\nMIT - see [LICENSE](LICENSE).\n"
}