{"id":16057708,"url":"https://github.com/aduth/pi_sense_hc_sr04_c","last_synced_at":"2025-03-16T06:27:16.652Z","repository":{"id":66273614,"uuid":"212897998","full_name":"aduth/pi_sense_hc_sr04_c","owner":"aduth","description":"Simple distance measurement for the HC-SR04 Ultrasonic Distance Sensor on Raspberry Pi","archived":false,"fork":false,"pushed_at":"2019-10-04T20:36:03.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T22:35:06.745Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","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/aduth.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":"2019-10-04T20:33:02.000Z","updated_at":"2019-10-04T20:36:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"e0f1fd75-1236-4579-986f-3feb0b985724","html_url":"https://github.com/aduth/pi_sense_hc_sr04_c","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aduth%2Fpi_sense_hc_sr04_c","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aduth%2Fpi_sense_hc_sr04_c/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aduth%2Fpi_sense_hc_sr04_c/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aduth%2Fpi_sense_hc_sr04_c/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aduth","download_url":"https://codeload.github.com/aduth/pi_sense_hc_sr04_c/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243835952,"owners_count":20355611,"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":[],"created_at":"2024-10-09T03:04:21.623Z","updated_at":"2025-03-16T06:27:16.647Z","avatar_url":"https://github.com/aduth.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HC-SR04 Distance\n\nSimple distance measurement program for the [HC-SR04 Ultrasonic Distance Sensor](https://www.adafruit.com/product/4007) on Raspberry Pi, written in C. Outputs a float value to standard output representing the measured distance in centimeters, to three decimal places.\n\n## Requirements\n\nThis program is targeted for use on a Raspberry Pi device, presumably running [Raspbian](https://www.raspberrypi.org/downloads/raspbian/) (or Raspbian Lite).\n\nThis program uses the [WiringPi library](http://wiringpi.com/) for GPIO interfacing. This is installed by default on Raspbian. If you're using Raspbian Lite, you will need to [install it manually](http://wiringpi.com/download-and-install/):\n\n```bash\nsudo apt-get install wiringpi\n```\n\n## Installation\n\nClone the repository, then build the program via the included Makefile:\n\n```\ngit clone https://github.com/aduth/pi_sense_hc_sr04_c.git\ncd pi_sense_hc_sr04_c\nmake\n```\n\n## Usage\n\nAssuming you are in the project directory and have compiled the program, simply run the executable:\n\n```\n./distance\n```\n\nBy default, the program assumes you have assigned the sensor's \"Echo\" as BCM 17 (WiringPi 0) and \"Trigger\" as BCM 18 (WiringPi 1).\n\nFor custom configurations, refer to the [GPIO Pinout guide for Raspberry Pi](https://pinout.xyz/), specifically the [WiringPi pin numbering](https://pinout.xyz/pinout/wiringpi). Assign these values as the ECHO and TRIGGER environment variables respectively:\n\n```\nECHO=0 TRIGGER=1 ./distance\n```\n\n## License\n\nCopyright 2019 Andrew Duthie\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faduth%2Fpi_sense_hc_sr04_c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faduth%2Fpi_sense_hc_sr04_c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faduth%2Fpi_sense_hc_sr04_c/lists"}