{"id":32164986,"url":"https://github.com/henrythebuilder/breadboard","last_synced_at":"2025-10-21T14:57:10.444Z","repository":{"id":57480758,"uuid":"217715425","full_name":"henrythebuilder/breadboard","owner":"henrythebuilder","description":"An helper library to 'breadboarding' with Elixir with a single-board computer using `Elixir Circuits`","archived":false,"fork":false,"pushed_at":"2021-11-24T13:53:06.000Z","size":122,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-21T14:57:00.641Z","etag":null,"topics":["ads1115","breadboard","circuits","elixir","elixir-circuits","gpio","i2c","joystick","orangepi-pc-board","pinout","pinout-map"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/henrythebuilder.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":"2019-10-26T13:49:18.000Z","updated_at":"2024-06-14T10:28:50.000Z","dependencies_parsed_at":"2022-09-26T17:41:21.867Z","dependency_job_id":null,"html_url":"https://github.com/henrythebuilder/breadboard","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/henrythebuilder/breadboard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henrythebuilder%2Fbreadboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henrythebuilder%2Fbreadboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henrythebuilder%2Fbreadboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henrythebuilder%2Fbreadboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/henrythebuilder","download_url":"https://codeload.github.com/henrythebuilder/breadboard/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henrythebuilder%2Fbreadboard/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280281400,"owners_count":26303709,"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","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"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":["ads1115","breadboard","circuits","elixir","elixir-circuits","gpio","i2c","joystick","orangepi-pc-board","pinout","pinout-map"],"created_at":"2025-10-21T14:57:08.857Z","updated_at":"2025-10-21T14:57:10.437Z","avatar_url":"https://github.com/henrythebuilder.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Breadboard\n\n[![Hex.pm](https://img.shields.io/hexpm/v/breadboard \"Hex version\")](https://hex.pm/packages/breadboard)\n![GitHub](https://img.shields.io/github/license/henrythebuilder/breadboard)\n\n`Breadboard` is an Elixir library developed to `breadboarding` with a single-board computer as simple as possible (this is the initial purpose).\n\nAll started using `Circuits.GPIO` on an [OrangePi PC board](http://www.orangepi.org/orangepipc/), all work fine but use GPIOs is not simple beacause of the logical pin numeration.\n\nFor example work on the pin ***12*** in the develop machine (without GPIOs) and in the OrangePi PC (pin label `PD14`) imply work in different way because in the board may be open the `logical pin` ***110*** in the sysfs user space !\n\nStarting from here the idea to try to simplify the access to pinout information.\n\n\n## Manage the pinout map\nThe module to manage the pinout information for the [supported platform](#supported-platform) is `Breadboard.Pinout`\n\nAny pin is identify by the `pin number`, a `pin key`, a `pin label` and the `pin name`.\n\nAs example the pin ***12*** can be referenced by the `pin number` or the `pin key`:\n\n```\nBreadboard.Pinout.label_to_pin(12)\nBreadboard.Pinout.label_to_pin(:pin12)\n```\n\nfor any platform in a trasparent way, but the return value change from ***12*** to ***110*** according to the defined platform.\n\nSame result can be obtained using the `pin name` or the `pin label` for the `stub` platform:\n```\nBreadboard.Pinout.label_to_pin(\"GPIO12\")\nBreadboard.Pinout.label_to_pin(:gpio12)\n```\n\nand for the specific OrangePi PC board:\n\n```\nBreadboard.Pinout.label_to_pin(\"PD14\")\nBreadboard.Pinout.label_to_pin(:pd14)\n```\n\nIn a reverse way the `pin label` may be find by the `Breadboard.Pinout.label_to_pin/1` method:\n\n```\nBreadboard.Pinout.pin_to_label(12)\nBreadboard.Pinout.pin_to_label(:pin12)\n```\n\nproduce the `:gpio12` or `:pd14` based on the configured platform.\n\n## Breadboard tools\n\n### Pinout Mapping\nIn order to semplify the integration of other platform pinout mapping two module are defined to expand the `Breadboard` library: `Breadboard.GPIO.BaseGPIO` and `Breadboard.GPIO.BaseGPIOHelper`.\n\nModule documentation explain also how GPIOs pinout mapping is made for a specific platform.\n\n### Play on GPIOs\nThe first module develop to play on GPIOs is the `Breadboard.Switch` module.\n\nThis module handle the feature of `Circuits.GPIO` to manage the operation on GPIOs with the support of `Breadboard.Pinout`:\n\n```\niex\u003e {:ok, switch} = Breadboard.Switch.connect([pin: :gpio18, direction: :output])\niex\u003e 18 = Breadboard.Switch.pin_number(switch)\niex\u003e Breadboard.Switch.turn_on(switch)\niex\u003e 1 = Breadboard.Switch.get_value(switch)\n```\n\nCheck the `Breadboard.Switch` module documentation for more information.\n\n### Play on I2C\nThe first module develop to play with I2C interface is `Breadboard.Joystick`, a simple module to manage an analog joystick connected to an 'ADS1115' analog to digital converter.\n\nIt is a very minimal module to test the I2C interface with `Circuits.I2C` and `ADS1115` library\n\nA simple integration is made by a dedicated test available in test suite with the specific tag `integration_sunxi_joystick`.\n\n\n## Breadboarding Environment\n\n### \"stub\" hardware abstraction layer\n`Circuits.GPIO` supports a \"stub\" hardware abstraction layer on platforms without GPIO support but as dependecy project this feature may not be present.\n\nIt's possible to enable the \"stub\" on Linux by setting `CIRCUITS_MIX_ENV` environment variable to `test`.\n\n### Project Unit Test\nSpecific platform test are 'tagged' in order to execute, by default, only the test on the corrispondent platform.\n\nInto the module documentation a check on platform is performed to exclude inappropriate test on different platform.\n\nMore details in the *project test files* and the example explained in the *module documentation*.\n\n### Supported Platform\nThe platform is identified by the \"`breadboard_platform`\" environment variable as explained in the `Breadboard` module.\n\nThis value is used to map the pins for the specific plaform.\n\nPlatform supported are:\n\n* ***stub*** -\u003e a \"stub\" hardware abstraction layer as defined in `Circuits.GPIO`\n* ***sunxi*** -\u003e the family of ARM SoCs from Allwinner Technology\n\n\n### Tested board\n- [***OrangePi PC board***](http://www.orangepi.org/orangepipc/)\n- [***OrangePi PC2 board***](http://www.orangepi.org/orangepipc2/)\n\n\n## Installation\n\nThe [breadboard package](https://hex.pm/packages/breadboard) can be installed by adding `breadboard` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:breadboard, \"~\u003e 0.0.6\"}\n  ]\nend\n```\n\nDocumentation is generated with [ExDoc](https://github.com/elixir-lang/ex_doc) and published on [HexDocs/breadboard](https://hexdocs.pm/breadboard).\n\n## Source code licensing rules\n\n### Author\n\nCopyright © 2020 Enrico Rivarola\n\n### License\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n[https://spdx.org/licenses/Apache-2.0.html](https://spdx.org/licenses/Apache-2.0.html)\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n\n### License identifier syntax\n\nThe license described above applies to the `Breadboard` library source as a whole.\n\nIndividual files contain the following tag instead of the full license text:\n\n`SPDX-License-Identifier: Apache-2.0`\n\nUse *SPDX short-form identifiers* enables machine reading/processing of software information as defined in [Software Package Data Exchange® (SPDX®)](https://spdx.org)\n\n\n*Check [NOTICE](NOTICE) and [LICENSE](LICENSE) project files for more detailed information.*\n\n---\n\n\nSPDX-License-Identifier: Apache-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhenrythebuilder%2Fbreadboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhenrythebuilder%2Fbreadboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhenrythebuilder%2Fbreadboard/lists"}