{"id":21278558,"url":"https://github.com/lbuque/haptic","last_synced_at":"2026-04-17T05:02:28.473Z","repository":{"id":137900363,"uuid":"537326690","full_name":"lbuque/haptic","owner":"lbuque","description":"A simple haptic feedback motor driver module for micropython.","archived":false,"fork":false,"pushed_at":"2022-09-16T06:19:25.000Z","size":1,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-05T00:59:57.516Z","etag":null,"topics":["esp32","micropython","t-watch","t-watch-2020"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lbuque.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-09-16T06:05:27.000Z","updated_at":"2022-09-16T06:22:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"38a624ad-66f4-4d1f-9938-2643211342c9","html_url":"https://github.com/lbuque/haptic","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lbuque/haptic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbuque%2Fhaptic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbuque%2Fhaptic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbuque%2Fhaptic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbuque%2Fhaptic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lbuque","download_url":"https://codeload.github.com/lbuque/haptic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbuque%2Fhaptic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31915900,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"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":["esp32","micropython","t-watch","t-watch-2020"],"created_at":"2024-11-21T10:14:59.516Z","updated_at":"2026-04-17T05:02:28.457Z","avatar_url":"https://github.com/lbuque.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Haptic feedback motor driver\n\nA simple haptic feedback motor driver module for micropython.\n\n## 验证与测试\n\n- LILYGO T-Watch\n\n## 使用指南\n\n### class Haptic\n\nA simple haptic feedback motor driver module.\nControl the motor through pwm and timer to simulate the effect of haptic feedback.\n\nUsage Model:\n\n```python\nfrom machine import Pin\nfrom haptic import  Haptic\n\ntouch = Pin(38, Pin.IN)\n\nh = Haptic(Pin(4))\n\nwhile True:\n    if touch.value() == 0:\n        h.once()\n```\n\n#### 构造\n\n##### haptic.Haptic(pin, freq: int = 100)\n\n使用以下参数构造并返回一个新的 Haptic 对象：\n\n- pin: pin is the entity on which the PWM is output, which is usually a machine.Pin object.\n- freq: Frequency of PWM output\n\n#### 方法\n\n##### Haptic.once(duration: int = 50)\n\nPlay the haptic effect once on the motor.\n\n- duration: The duration of the haptic effect, in milliseconds.\n\n##### Haptic.deint()\n\nDisabled Haptic Driver.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flbuque%2Fhaptic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flbuque%2Fhaptic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flbuque%2Fhaptic/lists"}