{"id":20563436,"url":"https://github.com/pilotak/beeper","last_synced_at":"2025-06-25T17:09:48.821Z","repository":{"id":91903162,"uuid":"283761144","full_name":"pilotak/beeper","owner":"pilotak","description":"Mbed library for simplification of toggling the output pin in time pattern.","archived":false,"fork":false,"pushed_at":"2022-11-09T15:57:09.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-02T03:45:55.386Z","etag":null,"topics":["led","mbed-os","morse-code","pattern","piezo","toggle"],"latest_commit_sha":null,"homepage":"","language":"C++","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/pilotak.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}},"created_at":"2020-07-30T11:59:49.000Z","updated_at":"2022-11-09T15:57:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"c32185bd-9d11-4403-9a20-4a3dc81265ce","html_url":"https://github.com/pilotak/beeper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pilotak/beeper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilotak%2Fbeeper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilotak%2Fbeeper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilotak%2Fbeeper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilotak%2Fbeeper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pilotak","download_url":"https://codeload.github.com/pilotak/beeper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilotak%2Fbeeper/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261917440,"owners_count":23229919,"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":["led","mbed-os","morse-code","pattern","piezo","toggle"],"created_at":"2024-11-16T04:18:49.973Z","updated_at":"2025-06-25T17:09:48.790Z","avatar_url":"https://github.com/pilotak.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Beeper\n[![Framework Badge mbed](https://img.shields.io/badge/framework-mbed-008fbe.svg)](https://os.mbed.com/)\n\nMbed library for simplification of toggling the output pin in time pattern ie.: buzzer/LED or it can be used as morse code generator\n\nYou can choose built-in tone duration or you can specify your own. All time units are in millisecods with **bit gain 16**. That means if you want to turn on the output for 16ms you would write it as 1 (32ms = 2, 64ms = 3, etc.), this technique saves the RAM because the \"pattern\" will be stored in 8-bit array - this has of course a limitation of maximum tone length to 4080ms.\n\n\u003e Please note: `Pause` is reserved \"tone duration\" in which no tone is played therefore the other tones can't have this duration. You can change this constant through `mbed_app.json` please see bellow.\n\n## Example\n```cpp\n#include \"mbed.h\"\n#include \"Beeper.h\"\n\nBeeper beeper(PB_6);\n\nconst uint8_t oneshot[] = {Beeper::Short, Beeper::Pause, Beeper::Short};\nconst uint8_t pattern[] = {Beeper::Long, Beeper::Short, Beeper::Pause, Beeper::Short};\n\nint main() {\n    // this pattern will be played only once\n    beeper.pattern(oneshot, sizeof(oneshot));\n    // give a time to play because previous cmd is asynchronous\n    ThisThread::sleep_for(5s);\n\n    // this pattern will be played in loop until you stop it\n    beeper.pattern(pattern, sizeof(pattern), true);\n    ThisThread::sleep_for(20s);\n\n    // stop the pattern\n    beeper = 0;\n    return 0;\n}\n```\n\n## How to change `Pause` duration\nRemember that the value will be multiplied by 16 as a result.\nTotal \"silence\" time: (50 * 16) + (2 * 160ms) *(delay between tones)* = 1120ms\n\n`mbed_app.json`\n```json\n{\n  \"target_overrides\": {\n    \"*\": {\n      \"beeper.pause\": 50\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpilotak%2Fbeeper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpilotak%2Fbeeper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpilotak%2Fbeeper/lists"}