{"id":16320449,"url":"https://github.com/tuupola/micropython-m5stack","last_synced_at":"2025-07-09T14:05:31.921Z","repository":{"id":66520929,"uuid":"106604158","full_name":"tuupola/micropython-m5stack","owner":"tuupola","description":"MicroPython Kitchen Sink for M5Stack","archived":false,"fork":false,"pushed_at":"2019-03-24T17:42:14.000Z","size":27,"stargazers_count":80,"open_issues_count":6,"forks_count":25,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-10-11T22:44:27.619Z","etag":null,"topics":["esp32","m5stack","micropython"],"latest_commit_sha":null,"homepage":null,"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/tuupola.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"publiccode":null,"codemeta":null}},"created_at":"2017-10-11T20:11:54.000Z","updated_at":"2024-09-16T03:46:09.000Z","dependencies_parsed_at":"2023-03-11T00:00:43.493Z","dependency_job_id":null,"html_url":"https://github.com/tuupola/micropython-m5stack","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuupola%2Fmicropython-m5stack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuupola%2Fmicropython-m5stack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuupola%2Fmicropython-m5stack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuupola%2Fmicropython-m5stack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tuupola","download_url":"https://codeload.github.com/tuupola/micropython-m5stack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244085007,"owners_count":20395523,"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":["esp32","m5stack","micropython"],"created_at":"2024-10-10T22:44:21.000Z","updated_at":"2025-03-20T22:31:09.041Z","avatar_url":"https://github.com/tuupola.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MicroPython Kitchen Sink for M5Stack\n\n![M5Stack](https://appelsiini.net/img/m5-wires-1400.jpg)\n\nThis repository contains few abstractions and helper libraries to help jumpstarting a MicroPython project with [M5Stack development kit](http://www.m5stack.com/). All development is done using [Loboris fork](https://github.com/loboris/MicroPython_ESP32_psRAM_LoBo) of MicroPython. Everything is still evolving. Code should be considered alpha quality. BC breaks will happen.\n\nUse `make sync` to upload files to the board. Not that you must have [rshell](https://github.com/dhylands/rshell) installed. After uploading `make repl` accesses the serial repl.\n\n```shell\n$ sudo pip3 install rshell\n$ make sync\n$ make repl\n```\n\nThe file `main.py` will contain the kitchen sink example. Helper libraries and absractions are in `lib` folder.\n\n## Display\n\nLight weight wrapper for [Loboris TFT module](https://github.com/loboris/MicroPython_ESP32_psRAM_LoBo/wiki/display)  which retains all the original api and properties but adds a few helper methods. See [Loboris wiki](https://github.com/loboris/MicroPython_ESP32_psRAM_LoBo/wiki/display) for documentation.\n\n```python\nimport m5stack\ntft = m5stack.Display()\n\ntft.text(tft.CENTER, 45,        \"`7MMM.     ,MMF'       \\n\")\ntft.text(tft.CENTER, tft.LASTY, \"  MMMb    dPMM         \\n\")\ntft.text(tft.CENTER, tft.LASTY, \"  M YM   ,M MM  M******\\n\")\ntft.text(tft.CENTER, tft.LASTY, \"  M  Mb  M' MM .M      \\n\")\ntft.text(tft.CENTER, tft.LASTY, \"  M  YM.P'  MM |bMMAg. \\n\")\ntft.text(tft.CENTER, tft.LASTY, \"  M  `YM'   MM      `Mb\\n\")\ntft.text(tft.CENTER, tft.LASTY, \".JML. `'  .JMML.     jM\\n\")\ntft.text(tft.CENTER, tft.LASTY, \"               (O)  ,M9\\n\")\ntft.text(tft.CENTER, tft.LASTY, \"                6mmm9  \\n\")\ntft.text(tft.CENTER, tft.LASTY, \"                       \\n\")\ntft.text(tft.CENTER, tft.LASTY, \"https://appelsiini.net/\")\n```\n\nHelper methods for turning the display on and off. Under the hood this just sets `TFT_LED_PIN` high or low.\n\n```python\ntft.backlight(False)\ntft.backlight(True)\n```\n\n## Buttons\n\nAbstraction for the provided buttons using IRQ. Buttons are debounced and they can detect both pressing and relasing of the button.\n\n```python\na = m5stack.ButtonA(\n    callback=lambda pin, pressed: print(\"Button A \" + (\"pressed\" if pressed else \"released\"))\n)\n\nb = m5stack.ButtonB(\n    callback=lambda pin, pressed: print(\"Button B \" + (\"pressed\" if pressed else \"released\"))\n)\n\nc = m5stack.ButtonC(callback=button_handler)\n\ndef button_handler(pin, pressed):\n    if pressed is True:\n        print(\"Button C pressed\")\n    else:\n        print(\"Button C released\")\n```\n\n## Speaker\n\nBasic support for playing tones in the builtin speaker.\n\n```python\nimport m5stack\n\nm5stack.tone(2200, duration=10, volume=1)\n```\n\n## Battery\n\nBasic support getting battery charge level. Value is returned as percentage in steps of 25 ie. 0, 25, 50, 75 and 100.\n\n```python\nfrom machine import I2C\nfrom ip5306 import IP5306\n\ni2c = I2C(scl=Pin(22), sda=Pin(21))\nbattery = IP5306(i2c)\nprint(str(battery.level) + \"%\"))\n```\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuupola%2Fmicropython-m5stack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftuupola%2Fmicropython-m5stack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuupola%2Fmicropython-m5stack/lists"}