{"id":26075649,"url":"https://github.com/themissingcow/pimoroni-presto-tmos","last_synced_at":"2025-03-09T01:05:52.298Z","repository":{"id":275420215,"uuid":"926028274","full_name":"themissingcow/pimoroni-presto-tmos","owner":"themissingcow","description":"A simple single-tasking OS for the awesome Pimoroni Presto, designed for page-based applications.","archived":false,"fork":false,"pushed_at":"2025-03-06T21:15:40.000Z","size":154,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-06T22:23:37.150Z","etag":null,"topics":["micropyhton","operating-system","pimoroni","pimoroni-presto"],"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/themissingcow.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","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":"2025-02-02T11:24:41.000Z","updated_at":"2025-03-06T21:15:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"6b8ac51f-4369-42cd-a111-a9d66f2f6b8f","html_url":"https://github.com/themissingcow/pimoroni-presto-tmos","commit_stats":null,"previous_names":["themissingcow/pimoroni-presto-tmos"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themissingcow%2Fpimoroni-presto-tmos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themissingcow%2Fpimoroni-presto-tmos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themissingcow%2Fpimoroni-presto-tmos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themissingcow%2Fpimoroni-presto-tmos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/themissingcow","download_url":"https://codeload.github.com/themissingcow/pimoroni-presto-tmos/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242627337,"owners_count":20160262,"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":["micropyhton","operating-system","pimoroni","pimoroni-presto"],"created_at":"2025-03-09T01:05:51.352Z","updated_at":"2025-03-09T01:05:52.292Z","avatar_url":"https://github.com/themissingcow.png","language":"Python","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"\u003e [!NOTE]\n\u003e This project is entirely independent of the lovely folks at Pimoroni.\n\u003e With their permission, the brand is in the repo name to help make it\n\u003e easier to find, it does not imply any official endorsement.\n\n# TmOS\n\nA basic single-tasking \"OS\" for the [Pimoroni Presto](https://shop.pimoroni.com/products/presto).\n\nIt hopes to simplify writing simple interactive applications based\naround paged displays of information.\n\nIt consists of a couple of single-file modules, to make deployment\nto devices easier.\n\n## Features\n\n- [x] RTC clock sync (requires WiFI)\n- [x] Glow LED setup\n- [x] Message handers\n- [x] Task execution with adjustable update frequency\n  - [x] Touches cause immediate updates (optional)\n  - [x] `async` tasks\n- [x] Timeout based display backlight / Glow LED dimming and sleep\n- [ ] Page-based window manager\n  - [x] Programmatic page navigation\n  - [x] Basic buttons with event callbacks\n  - [x] Tabbed UI for page switching\n  - [x] Themes with vector font support\n  - [ ] Brightness controls\n  - [ ] Clock\n\n## Getting started\n\n\u003e [!CAUTION]\n\u003e This project is in its early days and is subject to breaking changes.\n\n1. Upload [tmos.py](src/tmos.py) to your Presto (and\n   [tmos_ui.py](src/tmos_ui.py) if you want the window manager/themes).\n2. If you want to use WiFI, configure\n   [`secrets.py`](https://github.com/pimoroni/pimoroni-pico/blob/main/micropython/examples/pico_wireless/secrets.py) accordingly.\n3. Create an instance of `tmos.OS`.\n4. Configure as desired, and register one or more tasks to run.\n5. `boot` the OS with `run=True`.\n\nThe following example shows how to setup the Presto with  Wifi, sync the\nRTC clock using NTP, and update the display every second with the\ncurrent time. The display backlight will dim after a while, and sleep\nsome time later. Touching the screen wakes the display.\n\n```python\nimport time\nfrom tmos import OS\n\nos = OS()\n\nWHITE = os.presto.display.create_pen(255, 255, 255)\nBLACK = os.presto.display.create_pen(0, 0, 0)\n\nos.presto.display.set_font(\"bitmap8\")\n\ndef clock():\n    \"\"\"\n    Draw the current time at the top left.\n    \"\"\"\n    display = os.presto.display\n\n    display.set_pen(WHITE)\n    display.clear()\n    display.set_pen(BLACK)\n\n    year, month, day, hours, mins, secs, _, __ = time.localtime()\n    display.text(\n        f\"{day:02d}/{month:02d}/{year} {hours:02d}:{mins:02d}:{secs:02d}\", 10, 10\n    )\n\n    os.presto.update()\n\nos.add_task(clock, execution_frequency=1)\nos.boot(wifi=True, use_ntp=True, run=True)\n```\n\nSee the [examples](examples) for more.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemissingcow%2Fpimoroni-presto-tmos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthemissingcow%2Fpimoroni-presto-tmos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemissingcow%2Fpimoroni-presto-tmos/lists"}