{"id":16389460,"url":"https://github.com/mnishiguchi/apds9960","last_synced_at":"2026-06-20T17:32:14.329Z","repository":{"id":44518301,"uuid":"455000096","full_name":"mnishiguchi/apds9960","owner":"mnishiguchi","description":"Use APDS9960 color, proximity and gesture sensor in Elixir","archived":false,"fork":false,"pushed_at":"2022-02-10T00:46:37.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-28T13:11:06.465Z","etag":null,"topics":["elixir","nerves-project"],"latest_commit_sha":null,"homepage":"","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":"2022-02-03T02:02:42.000Z","updated_at":"2022-02-07T17:00:55.000Z","dependencies_parsed_at":"2022-09-16T11:22:16.873Z","dependency_job_id":null,"html_url":"https://github.com/mnishiguchi/apds9960","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/mnishiguchi/apds9960","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnishiguchi%2Fapds9960","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnishiguchi%2Fapds9960/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnishiguchi%2Fapds9960/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnishiguchi%2Fapds9960/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mnishiguchi","download_url":"https://codeload.github.com/mnishiguchi/apds9960/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnishiguchi%2Fapds9960/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34580039,"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-20T02:00:06.407Z","response_time":98,"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":["elixir","nerves-project"],"created_at":"2024-10-11T04:33:07.642Z","updated_at":"2026-06-20T17:32:14.311Z","avatar_url":"https://github.com/mnishiguchi.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# APDS9960\n\n[![Hex version](https://img.shields.io/hexpm/v/apds9960.svg 'Hex version')](https://hex.pm/packages/apds9960)\n[![API docs](https://img.shields.io/hexpm/v/apds9960.svg?label=docs 'API docs')](https://hexdocs.pm/apds9960)\n[![CI](https://github.com/mnishiguchi/apds9960/actions/workflows/ci.yml/badge.svg)](https://github.com/mnishiguchi/apds9960/actions/workflows/ci.yml)\n\nUse `APDS9960` color, proximity and gesture sensor in Elixir.\n\nBasically we want to do something similar to what [Adafruits APDS9960 guide] does.\n\n[Adafruits APDS9960 guide]: https://learn.adafruit.com/adafruit-apds9960-breakout/circuitpython\n\n## Installation\n\nAdd apds9960 to your list of dependencies in mix.exs:\n\n```elixir\ndef deps do\n  [\n    {:apds9960, \"~\u003e 0.1\"}\n  ]\nend\n```\n\n## Usage\n\n### Proximity detection\n\nThe proximity value ranges from 0 to 255, where the higher the number the closer an object is to the sensor.\n\n**Initialize the sensor**\n\n```elixir\nsensor = APDS9960.init()\n```\n\n**Enable the proximity engine**\n\n```elixir\nAPDS9960.enable(sensor, :proximity)\n```\n\n**Measure proximity**\n\n```elixir\nAPDS9960.proximity(sensor)\n```\n\n### RGB Color Sensing\n\nThe results are 16-bit values from 0 to 65535, where 0 means the minimum amount of color and 65535 is the maximum amount of color.\n\n**Initialize the sensor**\n\n```elixir\nsensor = APDS9960.init()\n```\n\n**Enable the color engine**\n\n```elixir\nAPDS9960.enable(sensor, :color)\n```\n\n**Retrieve the red, green, blue and clear color values**\n\n```elixir\nAPDS9960.color(sensor)\n# %{blue: 52, clear: 235, green: 73, red: 128}\n```\n\n### Gesture detection\n\n**Initialize the sensor**\n\n```elixir\nsensor = APDS9960.init()\n```\n\n**Enable the proximity and gesture engines**\n\n```elixir\nAPDS9960.enable(sensor, :proximity)\nAPDS9960.enable(sensor, :gesture)\n```\n\n**Detect gesture direction**\n\n```elixir\nAPDS9960.gesture(sensor, timeout: 5000)\n```\n\nFor more information, see [API reference](https://hexdocs.pm/apds9960/api-reference.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnishiguchi%2Fapds9960","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmnishiguchi%2Fapds9960","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnishiguchi%2Fapds9960/lists"}