{"id":51058340,"url":"https://github.com/fenix-hub/rp2040-zero-tinygo-test","last_synced_at":"2026-06-22T23:01:57.284Z","repository":{"id":362861940,"uuid":"1254300184","full_name":"fenix-hub/rp2040-zero-tinygo-test","owner":"fenix-hub","description":"Comprehensive test project for TinyGo hardware and software functionalities for RP2040-zero using LED, EC11 Encoder, SSD1306 OLED","archived":false,"fork":false,"pushed_at":"2026-06-06T08:05:21.000Z","size":2158,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-06T10:06:24.515Z","etag":null,"topics":["arduino","firmware","hardware","iot","oled-ssd1306","rp2040-zero","tinygo"],"latest_commit_sha":null,"homepage":"","language":"Go","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/fenix-hub.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-30T11:51:15.000Z","updated_at":"2026-06-06T08:05:25.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/fenix-hub/rp2040-zero-tinygo-test","commit_stats":null,"previous_names":["fenix-hub/rp2040-zero-tinygo-test"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/fenix-hub/rp2040-zero-tinygo-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fenix-hub%2Frp2040-zero-tinygo-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fenix-hub%2Frp2040-zero-tinygo-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fenix-hub%2Frp2040-zero-tinygo-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fenix-hub%2Frp2040-zero-tinygo-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fenix-hub","download_url":"https://codeload.github.com/fenix-hub/rp2040-zero-tinygo-test/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fenix-hub%2Frp2040-zero-tinygo-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34668499,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["arduino","firmware","hardware","iot","oled-ssd1306","rp2040-zero","tinygo"],"created_at":"2026-06-22T23:01:55.852Z","updated_at":"2026-06-22T23:01:57.277Z","avatar_url":"https://github.com/fenix-hub.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RP2040 Zero TinyGo Test\n\nA playground for testing device drivers and examples on RP2040 using TinyGo.\n\n![video](output.webp)\n\n## What's included\n\n- **Rotary encoder** with push switch\n- **SSD1306 OLED** display\n- **WS2812 RGB LED**\n\n## Setup\n\n### Prerequisites\n\n- [TinyGo](https://tinygo.org/getting-started/)\n- RP2040 board (Raspberry Pi Pico or compatible)\n- USB cable\n\n### Flash the project\n\n```bash\ntinygo flash -target=\u003cboard\u003e -port=/dev/ttyACM0 ./\n```\n\nReplace `\u003cboard\u003e` with your target (e.g., `pico`).\n\n### Read the serial output\n\n**Install picocom** (Linux):\n\n```bash\nsudo apt update \u0026\u0026 sudo apt install picocom\n```\n\n**Connect to console**:\n\n```bash\npicocom -b 115200 /dev/ttyACM0\n```\n\nExit: `Ctrl-A Ctrl-X`\n\n## Serial output\n\n`main.go` writes a single updating status line to the serial console at 115200 baud:\n\n```go\nfmt.Fprintf(machine.Serial, \"\\r%-60s\", line)\n```\n\nThis overwrites the same line in-place. Use `fmt.Fprintln()` for new lines instead:\n\n```go\nfmt.Fprintln(machine.Serial, line)\n```\n\nTo clear the line before printing:\n\n```go\nfmt.Fprintf(machine.Serial, \"\\r\\033[K%s\", line)\n```\n\n## Example: main.go\n\n### Rotary encoder\n\n- Reads via the `enc.Dir` channel (emits `+1` or `-1` per click)\n- Maintains a position counter by accumulating direction values\n\n```go\npos := 0\nfor {\n    select {\n    case dir := \u003c-enc.Dir:\n        pos += dir\n    }\n}\n```\n\n### Switch / button\n\n- Polls the pin for press state (active-low with pull-up)\n- Uses `enc.SwitchWasClicked()` to detect release (debounced)\n\n### OLED display\n\n- Renders text with `tinyfont` and shapes with `tinydraw`\n- Updates each frame\n\n### Colors\n\nColor constants must be `var`, not `const` (composite literals):\n\n```go\nvar WHITE = color.RGBA{255, 255, 255, 255}\n```\n\n## Files\n\n- `main.go` — example application\n- `go.mod` / `go.sum` — dependencies\n\n## BOM\nThis is the bill of materials:\n- [RP2040-zero](https://it.aliexpress.com/item/1005010768723373.html?spm=a2g0o.order_list.order_list_main.11.7fa33696r4LsTd\u0026gatewayAdapt=glo2ita)\n- [OLED](https://it.aliexpress.com/item/1005007672413060.html?spm=a2g0o.order_list.order_list_main.198.7fa33696r4LsTd\u0026gatewayAdapt=glo2ita)\n- [EC11](https://it.aliexpress.com/item/1005006127287538.html?spm=a2g0o.order_list.order_list_main.35.7fa33696r4LsTd\u0026gatewayAdapt=glo2ita)\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffenix-hub%2Frp2040-zero-tinygo-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffenix-hub%2Frp2040-zero-tinygo-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffenix-hub%2Frp2040-zero-tinygo-test/lists"}