{"id":21223928,"url":"https://github.com/niklauslee/active-buzzer","last_synced_at":"2025-03-15T01:33:59.356Z","repository":{"id":77037060,"uuid":"460275363","full_name":"niklauslee/active-buzzer","owner":"niklauslee","description":"Kaluma library to generate beep sound with active buzzer","archived":false,"fork":false,"pushed_at":"2022-02-17T04:57:09.000Z","size":60,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-21T17:30:47.833Z","etag":null,"topics":["buzzer","kaluma","sound"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/niklauslee.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}},"created_at":"2022-02-17T04:02:12.000Z","updated_at":"2022-02-17T04:48:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"8b87657c-3c52-4c50-8160-7808b8b04b42","html_url":"https://github.com/niklauslee/active-buzzer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklauslee%2Factive-buzzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklauslee%2Factive-buzzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklauslee%2Factive-buzzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklauslee%2Factive-buzzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niklauslee","download_url":"https://codeload.github.com/niklauslee/active-buzzer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243671781,"owners_count":20328694,"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":["buzzer","kaluma","sound"],"created_at":"2024-11-20T22:54:05.459Z","updated_at":"2025-03-15T01:33:59.328Z","avatar_url":"https://github.com/niklauslee.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Active Buzzer\n\nKaluma library to generate beep sound with active buzzer\n\n# Wiring\n\nHere is a wiring example.\n\n| Raspberry Pi Pico | Active Buzzer | \n| ----------------- | ------------- |\n| GND               | -             |\n| GP0               | +             |\n\nWiring for a board with TR (KY-012).\n\n| Raspberry Pi Pico | Active Buzzer | \n| ----------------- | ------------- |\n| 3V3               | VCC           |\n| GND               | GND           |\n| GP0               | I/O           |\n\n![wiring](https://github.com/niklauslee/active-buzzer/blob/main/images/wiring.jpg?raw=true)\n\n# Install\n\n```sh\nnpm install https://github.com/niklauslee/active-buzzer\n```\n\n# Usage\n\n```javascript\nconst buzzer = require('active-buzzer');\nconst PIN = 0;\n\n// beep 5 times.\nbuzzer.beep(PIN, 5);\ndelay(1000);\n\n// beep 10 times.\nbuzzer.beep(PIN, 10);\ndelay(1000);\n\n// beep 5 times with 100ms interval.\nbuzzer.beep(PIN, 5, 100);\n```\n\nExample for some boards with TR (reversed signal)\n\n```javascript\n// Example for boards with TR (beep = LOW, stop = HIGH)\n\nconst buzzer = require('active-buzzer');\nconst PIN = 0;\n\n// beep 5 times.\nbuzzer.beep(PIN, 5, 50, LOW);\ndelay(1000);\n\n// beep 10 times.\nbuzzer.beep(PIN, 10, 50, LOW);\ndelay(1000);\n\n// beep 5 times with 100ms interval.\nbuzzer.beep(PIN, 5, 100, LOW);\n```\n\n# API\n \n## beep(pin, count[, interval[, beepSignal]])\n \nGenerate beep sound.\n \n- **`pin`** `\u003cnumber\u003e` Pin number for active buzzer.\n- **`count`** `\u003cnumber\u003e` Number of count to beep.\n- **`interval`** `\u003cnumber\u003e` delay time in milliseconds to beep as well as stop. Default: `50`.\n- **`beepSignal`** `\u003cnumber\u003e` Signal to make beep sound. Default: `HIGH`. (In some boards with TR, LOW signal is required to make beep bound.)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklauslee%2Factive-buzzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniklauslee%2Factive-buzzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklauslee%2Factive-buzzer/lists"}