{"id":16389436,"url":"https://github.com/mnishiguchi/dypa01","last_synced_at":"2026-06-19T19:31:22.626Z","repository":{"id":57492197,"uuid":"400913449","full_name":"mnishiguchi/dypa01","owner":"mnishiguchi","description":"Use DYP-A01 ultrasonic distance sensor in Elixir","archived":false,"fork":false,"pushed_at":"2021-09-04T21:36:02.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-20T19:23:42.474Z","etag":null,"topics":["distance-sensor","dyp-a01","elixir","elixir-lang","elixir-language","nerves","nerves-project","sensor","sensors"],"latest_commit_sha":null,"homepage":"https://dev.to/mnishiguchi/use-dyp-a01-ultrasonic-distance-sensor-in-elixir-bp4","language":"Elixir","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/mnishiguchi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-28T23:57:09.000Z","updated_at":"2021-09-04T21:36:04.000Z","dependencies_parsed_at":"2022-08-28T11:50:53.984Z","dependency_job_id":null,"html_url":"https://github.com/mnishiguchi/dypa01","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/mnishiguchi/dypa01","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnishiguchi%2Fdypa01","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnishiguchi%2Fdypa01/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnishiguchi%2Fdypa01/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnishiguchi%2Fdypa01/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mnishiguchi","download_url":"https://codeload.github.com/mnishiguchi/dypa01/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnishiguchi%2Fdypa01/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34546191,"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-19T02:00:06.005Z","response_time":61,"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":["distance-sensor","dyp-a01","elixir","elixir-lang","elixir-language","nerves","nerves-project","sensor","sensors"],"created_at":"2024-10-11T04:32:58.636Z","updated_at":"2026-06-19T19:31:22.606Z","avatar_url":"https://github.com/mnishiguchi.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DYP-A01\n\n[![Hex version](https://img.shields.io/hexpm/v/dypa01.svg 'Hex version')](https://hex.pm/packages/dypa01)\n[![API docs](https://img.shields.io/hexpm/v/dypa01.svg?label=docs 'API docs')](https://hexdocs.pm/dypa01)\n[![CI](https://github.com/mnishiguchi/dypa01/actions/workflows/ci.yml/badge.svg)](https://github.com/mnishiguchi/dypa01/actions/workflows/ci.yml)\n[![Publish](https://github.com/mnishiguchi/dypa01/actions/workflows/publish.yml/badge.svg)](https://github.com/mnishiguchi/dypa01/actions/workflows/publish.yml)\n\nUse [DYP-A01](https://www.adafruit.com/product/4664) ultrasonic distance sensor in Elixir.\n\n## Usage\n\n```elixir\n# List available serial ports\niex\u003e Circuits.UART.enumerate\n%{\n  \"ttyAMA0\" =\u003e %{},\n  \"ttyS0\" =\u003e %{},\n  \"ttyUSB0\" =\u003e %{\n    description: \"CP2102 USB to UART Bridge Controller\",\n    manufacturer: \"Silicon Labs\",\n    product_id: 60000,\n    serial_number: \"0001\",\n    vendor_id: 4292\n  }\n}\n\n# Start a gen server for interacting with a DYP-A01 sensor on port ttyAMA0\niex\u003e {:ok, pid} = DYPA01.start_link(port_name: \"ttyAMA0\")\n{:ok, #PID\u003c0.1407.0\u003e}\n\n# Measure the current distance\niex\u003e DYPA01.measure(pid)\n{:ok, %DYPA01.Measurement{distance_mm: 1680, timestamp_ms: 321793}}\n```\n\n## Wiring\n\nThis library assumes the \"UART auto output\" mode, which is enabled when the sensor's \"RX\" cable is unused.\nFor example, when connecting the sensor to Raspberry Pi's GPIO pins, use only the following three pins.\n\n| Cable number | Cable name | Raspberry Pi |\n| ------------ | ---------- | ------------ |\n| 1            | VCC        | GPIO 4 (5V)  |\n| 2            | GND        | GPIO 6 (GND) |\n| 3            | RX         |              |\n| 4            | TX         | GPIO 8 (RX)  |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnishiguchi%2Fdypa01","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmnishiguchi%2Fdypa01","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnishiguchi%2Fdypa01/lists"}