{"id":16162863,"url":"https://github.com/luckyturtledev/pybadge-high","last_synced_at":"2026-01-15T22:25:27.579Z","repository":{"id":161146346,"uuid":"608844307","full_name":"LuckyTurtleDev/pybadge-high","owner":"LuckyTurtleDev","description":"High Level Board Support crate for the Adafruit pybadge","archived":false,"fork":false,"pushed_at":"2025-04-16T09:53:40.000Z","size":106,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-23T23:24:33.279Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LuckyTurtleDev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2023-03-02T21:16:46.000Z","updated_at":"2025-04-16T09:53:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"42bb0019-edab-4b3d-9fc8-94f96eb812c8","html_url":"https://github.com/LuckyTurtleDev/pybadge-high","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/LuckyTurtleDev/pybadge-high","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuckyTurtleDev%2Fpybadge-high","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuckyTurtleDev%2Fpybadge-high/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuckyTurtleDev%2Fpybadge-high/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuckyTurtleDev%2Fpybadge-high/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LuckyTurtleDev","download_url":"https://codeload.github.com/LuckyTurtleDev/pybadge-high/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuckyTurtleDev%2Fpybadge-high/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28472627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T22:13:38.078Z","status":"ssl_error","status_checked_at":"2026-01-15T22:12:11.737Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-10-10T02:33:32.831Z","updated_at":"2026-01-15T22:25:27.574Z","avatar_url":"https://github.com/LuckyTurtleDev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pybadge-high ![License: MIT OR Apache-2.0](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue) [![pybadge-high on crates.io](https://img.shields.io/crates/v/pybadge-high)](https://crates.io/crates/pybadge-high) [![pybadge-high on docs.rs](https://docs.rs/pybadge-high/badge.svg)](https://docs.rs/pybadge-high) [![Source Code Repository](https://img.shields.io/badge/Code-On%20GitHub-blue?logo=GitHub)](https://github.com/LuckyTurtleDev/pybadge-high)\n\nGoal of this crate is to provide **high level hardware abstraction** layer for the pybade and the edgebadge.\nIt should allow people with no/less knowledge of rust and embedded hardware, to program the boards mention before.\nIf you try to do anything hardware-near or usinig additonal expensions,\nyou should probably use the more hardware-near the [edgebadge][__link0] or [atsamd_hal][__link1] crate instead.\n\n## Setup\n\n##### Installation\n\n* Install rustup.\n  I recommand to use the [package manger][__link2] of your operation system.\n  Alternative you can install it from \u003chttps://www.rust-lang.org/tools/install\u003e\n* install the rust thumbv7em-none-eabihf target. (the architecture of the micronctroller)\n\n```bash\nrustup target install thumbv7em-none-eabihf\n```\n\n* optional: install nightly toolchain for better doc (only relevant if you build the doc by yourself).\n\n```rust\nrustup toolchain install nightly --target thumbv7em-none-eabihf\n```\n\n* install the [hf2-cli][__link3] flasher\n\n##### Create your Project\n\n* Create a new rust project.\n\n```bash\ncargo new my-app\n```\n\n* Add a `.cargo/config.toml` with the following content, to define target architecture and flasher\n\n```toml\n[target.thumbv7em-none-eabihf]\nrunner = \"hf2 elf\"\n#runner = 'probe-run --chip ATSAMD51J19A'\n\n[build]\ntarget = \"thumbv7em-none-eabihf\"\nrustflags = [\n\n  # This is needed if your flash or ram addresses are not aligned to 0x10000 in memory.x\n  # See https://github.com/rust-embedded/cortex-m-quickstart/pull/95\n  \"-C\", \"link-arg=--nmagic\",\n\n  \"-C\", \"link-arg=-Tlink.x\",\n]\n```\n\n* Add this crate as dependency\n\n```bash\ncargo add pybadge-high\n```\n\n* optional: add this to your `cargo.toml` for better optimizations\n\n```toml\n[profile.release]\ncodegen-units = 1 # better optimizations\ndebug = true # symbols are nice and they don't increase the size on Flash\nlto = true # better optimizations\n```\n\n* Addjust your `main.rs`\n\nYou need to do some changes at your `main.rs`.\nFirst you must disable the rust standart libary by adding `#![no_std]`, because it is not supported by the pybadge.\nThis does also mean you can not use the default main function any more and must disable it with `#![no_main]`.\nBut because we still need a main function to enter the code we need to define our own main with `#[entry]`.\nThis main function does never return (`!`).\nOtherwise the pybadge would do random stuff after the program has finish.\nSo we need a endless loop.\nTo get access to the peripherals of the pybadge, like display, buttons, leds etc you call [`PyBadge::take()`][__link4].\nThis function can only called once at runtime otherwise it will return an Error.\n\n```rust\n#![no_std]\n#![no_main]\n\nuse pybadge_high::{prelude::*, PyBadge};\n\n#[entry]\nfn main() -\u003e ! {\n\tlet mut pybadge = PyBadge::take().unwrap();\n\tloop {}\n}\n```\n\nWhen a program does panic, the red led at the back of the board starts flashing.\nIf the `bluescreen`(default) feature is enable, the display does show the postion of the error.\nWhen the `beep_panic` feature is enable, the pybadge also beep for 3 seconds.\n\n##### Flashing:\n\nTo flash you program, put your device in bootloader mode by hitting the reset button twice.\nAfter this excute\n\n```bash\ncargo run --release\n```\n\nThe display does not work until you have press the reset button of the pybadge after flashing.\n\n## Feature-flags\n\nThis crate has spilt functionallity in multiple feature flags.\nSee the [rust book][__link5] for more information about features.\nEnabling only the feauters, which are needed, helps to keep the binary size small\nand reduce the number of needed dependencies.\n\nThe following features are aviable:\n\n* **`beep_panic`** —  beep for 3 seconds, when rust pancics\n\n* **`bluescreen`** *(enabled by default)* —  show a bluescreen with error postion, when rust pancics\n\n* **`bluescreen-message-nightly`** —  show also error message at bluescreen, when rust panics.\n  \n  This features depends on rust nightly features and needs the nightly toolchain.\n  It has no effect, when compiled with stable.\n  Because it use nightly features it might break in future rust versions.\n\n* **`neopixel`** —  support for the Neopixel below the screen\n\n* **`usb`** —  support for serial communication over usb\n\n* **`pwm_sound`** —  support for single frequenc sound\n\n* **`time`** *(enabled by default)* —  support for time measurement\n\n\n [__link0]: https://crates.io/crates/edgebadge\n [__link1]: https://docs.rs/atsamd-hal/latest/atsamd_hal/\n [__link2]: https://repology.org/project/rustup/versions\n [__link3]: https://crates.io/crates/hf2-cli\n [__link4]: `PyBadge::take()`\n [__link5]: https://doc.rust-lang.org/cargo/reference/features.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluckyturtledev%2Fpybadge-high","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluckyturtledev%2Fpybadge-high","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluckyturtledev%2Fpybadge-high/lists"}